import{s as Mt,o as gt,n as ze}from"../chunks/scheduler.37c15a92.js";import{S as wt,i as yt,g as r,s as o,r as u,m as J,A as bt,h as c,f as l,c as a,j as Se,u as h,x as d,n as Z,k as W,y as x,a as n,v as f,d as M,t as g,w}from"../chunks/index.2bf4358c.js";import{T as Pe}from"../chunks/Tip.363c041f.js";import{C as re}from"../chunks/CodeBlock.4e987730.js";import{H as pe}from"../chunks/Heading.8ada512a.js";import{E as Tt}from"../chunks/index.e71982be.js";function $t(C){let m,s,y="this notebook",p;return{c(){m=J("You can follow the code in "),s=r("a"),s.textContent=y,p=J(" that you can run using Google Colab."),this.h()},l(i){m=Z(i,"You can follow the code in "),s=c(i,"A",{href:!0,target:!0,"data-svelte-h":!0}),d(s)!=="svelte-1oi8dw1"&&(s.textContent=y),p=Z(i," that you can run using Google Colab."),this.h()},h(){W(s,"href","https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/tools.ipynb"),W(s,"target","_blank")},m(i,b){n(i,m,b),n(i,s,b),n(i,p,b)},p:ze,d(i){i&&(l(m),l(s),l(p))}}}function jt(C){let m,s,y="Function Calling Guide",p;return{c(){m=J("When using an agent or LLM with function calling, the tool selected (and the arguments written for that tool) rely strongly on the tool name and description of the purpose and arguments of the tool. Learn more about function calling in the "),s=r("a"),s.textContent=y,p=J("."),this.h()},l(i){m=Z(i,"When using an agent or LLM with function calling, the tool selected (and the arguments written for that tool) rely strongly on the tool name and description of the purpose and arguments of the tool. Learn more about function calling in the "),s=c(i,"A",{href:!0,"data-svelte-h":!0}),d(s)!=="svelte-o8286s"&&(s.textContent=y),p=Z(i,"."),this.h()},h(){W(s,"href","https://docs.llamaindex.ai/en/stable/examples/workflow/function_calling_agent/")},m(i,b){n(i,m,b),n(i,s,b),n(i,p,b)},p:ze,d(i){i&&(l(m),l(s),l(p))}}}function vt(C){let m,s,y="LlamaHub";return{c(){m=J("You can find toolspecs and utility tools on the "),s=r("a"),s.textContent=y,this.h()},l(p){m=Z(p,"You can find toolspecs and utility tools on the "),s=c(p,"A",{href:!0,"data-svelte-h":!0}),d(s)!=="svelte-b92hie"&&(s.textContent=y),this.h()},h(){W(s,"href","https://llamahub.ai/")},m(p,i){n(p,m,i),n(p,s,i)},p:ze,d(p){p&&(l(m),l(s))}}}function xt(C){let m,s,y,p,i,b,I,Ke=`<strong>Defining a clear set of Tools is crucial to performance.</strong> As we discussed in <a href="../../unit1/tools">unit 1</a>, clear tool interfaces are easier for LLMs to use.
Much like a software API interface for human engineers, they can get more out of the tool if it’s easy to understand how it works.`,ue,B,De="There are <strong>four main types of tools in LlamaIndex</strong>:",he,k,Oe='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/tools.png" alt="Tools"/>',fe,V,et="<li><code>FunctionTool</code>: Convert any Python function into a tool that an agent can use. It automatically figures out how the function works.</li> <li><code>QueryEngineTool</code>: A tool that lets agents use query engines. Since agents are built on query engines, they can also use other agents as tools.</li> <li><code>Toolspecs</code>: Sets of tools created by the community, which often include tools for specific services like Gmail.</li> <li><code>Utility Tools</code>: Special tools that help handle large amounts of data from other tools.</li>",Me,L,tt="We will go over each of them in more detail below.",ge,E,we,U,ye,N,lt=`A FunctionTool provides a simple way to wrap any Python function and make it available to an agent.
You can pass either a synchronous or asynchronous function to the tool, along with optional <code>name</code> and <code>description</code> parameters.
The name and description are particularly important as they help the agent understand when and how to use the tool effectively.
Let’s look at how to create a FunctionTool below and then call it.`,be,R,Te,G,$e,Y,je,X,nt=`The <code>QueryEngine</code> we defined in the previous unit can be easily transformed into a tool using the <code>QueryEngineTool</code> class.
Let’s see how to create a <code>QueryEngineTool</code> from a <code>QueryEngine</code> in the example below.`,ve,H,xe,S,Je,Q,ot=`Think of <code>ToolSpecs</code> as collections of tools that work together harmoniously - like a well-organized professional toolkit.
Just as a mechanic’s toolkit contains complementary tools that work together for vehicle repairs, a <code>ToolSpec</code> combines related tools for specific purposes.
For example, an accounting agent’s <code>ToolSpec</code> might elegantly integrate spreadsheet capabilities, email functionality, and calculation tools to handle financial tasks with precision and efficiency.`,Ze,T,ce,at="Install the Google Toolspec",Qe,F,st="section on the LlamaHub",Fe,A,Ce,q,it="And now we can load the toolspec and convert it to a list of tools.",Ue,P,Ge,z,rt="To get a more detailed view of the tools, we can take a look at the <code>metadata</code> of each tool.",_e,K,We,D,Ie,O,ct=`LlamaIndex also allows using MCP tools through a <a href="https://llamahub.ai/l/tools/llama-index-tools-mcp?from=" rel="nofollow">ToolSpec on the LlamaHub</a>.
You can simply run an MCP server and start using it through the following implementation.`,Be,$,me,mt="Install the MCP Toolspec",Ae,ee,pt="section on the LlamaHub",qe,te,ke,le,Ve,ne,Le,oe,dt=`Oftentimes, directly querying an API <strong>can return an excessive amount of data</strong>, some of which may be irrelevant, overflow the context window of the LLM, or unnecessarily increase the number of tokens that you are using.
Let’s walk through our two main utility tools below.`,Ee,ae,ut="<li><code>OnDemandToolLoader</code>: This tool turns any existing LlamaIndex data loader (BaseReader class) into a tool that an agent can use. The tool can be called with all the parameters needed to trigger <code>load_data</code> from the data loader, along with a natural language query string. During execution, we first load data from the data loader, index it (for instance with a vector store), and then query it ‘on-demand’. All three of these steps happen in a single tool call.</li> <li><code>LoadAndSearchToolSpec</code>: The LoadAndSearchToolSpec takes in any existing Tool as input. As a tool spec, it implements <code>to_tool_list</code>, and when that function is called, two tools are returned: a loading tool and then a search tool. The load Tool execution would call the underlying Tool, and then index the output (by default with a vector index). The search Tool execution would take in a query string as input and call the underlying index.</li>",Ne,_,Re,se,ht="Now that we understand the basics of agents and tools in LlamaIndex, let’s see how we can <strong>use LlamaIndex to create configurable and manageable workflows!</strong>",Ye,ie,Xe,de,He;return i=new pe({props:{title:"Using Tools in LlamaIndex",local:"using-tools-in-llamaindex",headingTag:"h1"}}),E=new pe({props:{title:"Creating a FunctionTool",local:"creating-a-functiontool",headingTag:"h2"}}),U=new Pe({props:{$$slots:{default:[$t]},$$scope:{ctx:C}}}),R=new re({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEElMEFkZWYlMjBnZXRfd2VhdGhlcihsb2NhdGlvbiUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyVXNlZnVsJTIwZm9yJTIwZ2V0dGluZyUyMHRoZSUyMHdlYXRoZXIlMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBwcmludChmJTIyR2V0dGluZyUyMHdlYXRoZXIlMjBmb3IlMjAlN0Jsb2NhdGlvbiU3RCUyMiklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyVGhlJTIwd2VhdGhlciUyMGluJTIwJTdCbG9jYXRpb24lN0QlMjBpcyUyMHN1bm55JTIyJTBBJTBBdG9vbCUyMCUzRCUyMEZ1bmN0aW9uVG9vbC5mcm9tX2RlZmF1bHRzKCUwQSUyMCUyMCUyMCUyMGdldF93ZWF0aGVyJTJDJTBBJTIwJTIwJTIwJTIwbmFtZSUzRCUyMm15X3dlYXRoZXJfdG9vbCUyMiUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEJTIyVXNlZnVsJTIwZm9yJTIwZ2V0dGluZyUyMHRoZSUyMHdlYXRoZXIlMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMkMlMEEpJTBBdG9vbC5jYWxsKCUyMk5ldyUyMFlvcmslMjIp",highlighted:`<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_weather</span>(<span class="hljs-params">location: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Useful for getting the weather for a given location.&quot;&quot;&quot;</span>
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Getting weather for <span class="hljs-subst">{location}</span>&quot;</span>)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;The weather in <span class="hljs-subst">{location}</span> is sunny&quot;</span>

tool = FunctionTool.from_defaults(
    get_weather,
    name=<span class="hljs-string">&quot;my_weather_tool&quot;</span>,
    description=<span class="hljs-string">&quot;Useful for getting the weather for a given location.&quot;</span>,
)
tool.call(<span class="hljs-string">&quot;New York&quot;</span>)`,wrap:!1}}),G=new Pe({props:{$$slots:{default:[jt]},$$scope:{ctx:C}}}),Y=new pe({props:{title:"Creating a QueryEngineTool",local:"creating-a-queryenginetool",headingTag:"h2"}}),H=new re({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUlMjBpbXBvcnQlMjBWZWN0b3JTdG9yZUluZGV4JTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBRdWVyeUVuZ2luZVRvb2wlMEFmcm9tJTIwbGxhbWFfaW5kZXgubGxtcy5odWdnaW5nZmFjZV9hcGklMjBpbXBvcnQlMjBIdWdnaW5nRmFjZUluZmVyZW5jZUFQSSUwQWZyb20lMjBsbGFtYV9pbmRleC5lbWJlZGRpbmdzLmh1Z2dpbmdmYWNlJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VFbWJlZGRpbmclMEFmcm9tJTIwbGxhbWFfaW5kZXgudmVjdG9yX3N0b3Jlcy5jaHJvbWElMjBpbXBvcnQlMjBDaHJvbWFWZWN0b3JTdG9yZSUwQSUwQWVtYmVkX21vZGVsJTIwJTNEJTIwSHVnZ2luZ0ZhY2VFbWJlZGRpbmcoJTIyQkFBSSUyRmJnZS1zbWFsbC1lbi12MS41JTIyKSUwQSUwQWRiJTIwJTNEJTIwY2hyb21hZGIuUGVyc2lzdGVudENsaWVudChwYXRoJTNEJTIyLiUyRmFsZnJlZF9jaHJvbWFfZGIlMjIpJTBBY2hyb21hX2NvbGxlY3Rpb24lMjAlM0QlMjBkYi5nZXRfb3JfY3JlYXRlX2NvbGxlY3Rpb24oJTIyYWxmcmVkJTIyKSUwQXZlY3Rvcl9zdG9yZSUyMCUzRCUyMENocm9tYVZlY3RvclN0b3JlKGNocm9tYV9jb2xsZWN0aW9uJTNEY2hyb21hX2NvbGxlY3Rpb24pJTBBJTBBaW5kZXglMjAlM0QlMjBWZWN0b3JTdG9yZUluZGV4LmZyb21fdmVjdG9yX3N0b3JlKHZlY3Rvcl9zdG9yZSUyQyUyMGVtYmVkX21vZGVsJTNEZW1iZWRfbW9kZWwpJTBBJTBBbGxtJTIwJTNEJTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEkobW9kZWxfbmFtZSUzRCUyMlF3ZW4lMkZRd2VuMi41LUNvZGVyLTMyQi1JbnN0cnVjdCUyMiklMEFxdWVyeV9lbmdpbmUlMjAlM0QlMjBpbmRleC5hc19xdWVyeV9lbmdpbmUobGxtJTNEbGxtKSUwQXRvb2wlMjAlM0QlMjBRdWVyeUVuZ2luZVRvb2wuZnJvbV9kZWZhdWx0cyhxdWVyeV9lbmdpbmUlMkMlMjBuYW1lJTNEJTIyc29tZSUyMHVzZWZ1bCUyMG5hbWUlMjIlMkMlMjBkZXNjcmlwdGlvbiUzRCUyMnNvbWUlMjB1c2VmdWwlMjBkZXNjcmlwdGlvbiUyMik=",highlighted:`<span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> VectorStoreIndex
<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> QueryEngineTool
<span class="hljs-keyword">from</span> llama_index.llms.huggingface_api <span class="hljs-keyword">import</span> HuggingFaceInferenceAPI
<span class="hljs-keyword">from</span> llama_index.embeddings.huggingface <span class="hljs-keyword">import</span> HuggingFaceEmbedding
<span class="hljs-keyword">from</span> llama_index.vector_stores.chroma <span class="hljs-keyword">import</span> ChromaVectorStore

embed_model = HuggingFaceEmbedding(<span class="hljs-string">&quot;BAAI/bge-small-en-v1.5&quot;</span>)

db = chromadb.PersistentClient(path=<span class="hljs-string">&quot;./alfred_chroma_db&quot;</span>)
chroma_collection = db.get_or_create_collection(<span class="hljs-string">&quot;alfred&quot;</span>)
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)

index = VectorStoreIndex.from_vector_store(vector_store, embed_model=embed_model)

llm = HuggingFaceInferenceAPI(model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>)
query_engine = index.as_query_engine(llm=llm)
tool = QueryEngineTool.from_defaults(query_engine, name=<span class="hljs-string">&quot;some useful name&quot;</span>, description=<span class="hljs-string">&quot;some useful description&quot;</span>)`,wrap:!1}}),S=new pe({props:{title:"Creating Toolspecs",local:"creating-toolspecs",headingTag:"h2"}}),A=new re({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LXRvb2xzLWdvb2dsZQ==",highlighted:"pip install llama-index-tools-google",wrap:!1}}),P=new re({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLmdvb2dsZSUyMGltcG9ydCUyMEdtYWlsVG9vbFNwZWMlMEElMEF0b29sX3NwZWMlMjAlM0QlMjBHbWFpbFRvb2xTcGVjKCklMEF0b29sX3NwZWNfbGlzdCUyMCUzRCUyMHRvb2xfc3BlYy50b190b29sX2xpc3QoKQ==",highlighted:`<span class="hljs-keyword">from</span> llama_index.tools.google <span class="hljs-keyword">import</span> GmailToolSpec

tool_spec = GmailToolSpec()
tool_spec_list = tool_spec.to_tool_list()`,wrap:!1}}),K=new re({props:{code:"JTVCKHRvb2wubWV0YWRhdGEubmFtZSUyQyUyMHRvb2wubWV0YWRhdGEuZGVzY3JpcHRpb24pJTIwZm9yJTIwdG9vbCUyMGluJTIwdG9vbF9zcGVjX2xpc3QlNUQ=",highlighted:'[(tool.metadata.name, tool.metadata.description) <span class="hljs-keyword">for</span> tool <span class="hljs-keyword">in</span> tool_spec_list]',wrap:!1}}),D=new pe({props:{title:"Model Context Protocol (MCP) in LlamaIndex",local:"model-context-protocol-mcp-in-llamaindex",headingTag:"h3"}}),te=new re({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LXRvb2xzLW1jcA==",highlighted:"pip install llama-index-tools-mcp",wrap:!1}}),le=new re({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLm1jcCUyMGltcG9ydCUyMEJhc2ljTUNQQ2xpZW50JTJDJTIwTWNwVG9vbFNwZWMlMEElMEElMjMlMjBXZSUyMGNvbnNpZGVyJTIwdGhlcmUlMjBpcyUyMGElMjBtY3AlMjBzZXJ2ZXIlMjBydW5uaW5nJTIwb24lMjAxMjcuMC4wLjElM0E4MDAwJTJDJTIwb3IlMjB5b3UlMjBjYW4lMjB1c2UlMjB0aGUlMjBtY3AlMjBjbGllbnQlMjB0byUyMGNvbm5lY3QlMjB0byUyMHlvdXIlMjBvd24lMjBtY3AlMjBzZXJ2ZXIuJTBBbWNwX2NsaWVudCUyMCUzRCUyMEJhc2ljTUNQQ2xpZW50KCUyMmh0dHAlM0ElMkYlMkYxMjcuMC4wLjElM0E4MDAwJTJGc3NlJTIyKSUwQW1jcF90b29sJTIwJTNEJTIwTWNwVG9vbFNwZWMoY2xpZW50JTNEbWNwX2NsaWVudCklMEElMEElMjMlMjBnZXQlMjB0aGUlMjBhZ2VudCUwQWFnZW50JTIwJTNEJTIwYXdhaXQlMjBnZXRfYWdlbnQobWNwX3Rvb2wpJTBBJTBBJTIzJTIwY3JlYXRlJTIwdGhlJTIwYWdlbnQlMjBjb250ZXh0JTBBYWdlbnRfY29udGV4dCUyMCUzRCUyMENvbnRleHQoYWdlbnQp",highlighted:`<span class="hljs-keyword">from</span> llama_index.tools.mcp <span class="hljs-keyword">import</span> BasicMCPClient, McpToolSpec

<span class="hljs-comment"># We consider there is a mcp server running on 127.0.0.1:8000, or you can use the mcp client to connect to your own mcp server.</span>
mcp_client = BasicMCPClient(<span class="hljs-string">&quot;http://127.0.0.1:8000/sse&quot;</span>)
mcp_tool = McpToolSpec(client=mcp_client)

<span class="hljs-comment"># get the agent</span>
agent = <span class="hljs-keyword">await</span> get_agent(mcp_tool)

<span class="hljs-comment"># create the agent context</span>
agent_context = Context(agent)`,wrap:!1}}),ne=new pe({props:{title:"Utility Tools",local:"utility-tools",headingTag:"h2"}}),_=new Pe({props:{$$slots:{default:[vt]},$$scope:{ctx:C}}}),ie=new Tt({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit2/llama-index/tools.mdx"}}),{c(){m=r("meta"),s=o(),y=r("p"),p=o(),u(i.$$.fragment),b=o(),I=r("p"),I.innerHTML=Ke,ue=o(),B=r("p"),B.innerHTML=De,he=o(),k=r("p"),k.innerHTML=Oe,fe=o(),V=r("ol"),V.innerHTML=et,Me=o(),L=r("p"),L.textContent=tt,ge=o(),u(E.$$.fragment),we=o(),u(U.$$.fragment),ye=o(),N=r("p"),N.innerHTML=lt,be=o(),u(R.$$.fragment),Te=o(),u(G.$$.fragment),$e=o(),u(Y.$$.fragment),je=o(),X=r("p"),X.innerHTML=nt,ve=o(),u(H.$$.fragment),xe=o(),u(S.$$.fragment),Je=o(),Q=r("p"),Q.innerHTML=ot,Ze=o(),T=r("details"),ce=r("summary"),ce.textContent=at,Qe=J(`
As introduced in the `),F=r("a"),F.textContent=st,Fe=J(`, we can install the Google toolspec with the following command:

	`),u(A.$$.fragment),Ce=o(),q=r("p"),q.textContent=it,Ue=o(),u(P.$$.fragment),Ge=o(),z=r("p"),z.innerHTML=rt,_e=o(),u(K.$$.fragment),We=o(),u(D.$$.fragment),Ie=o(),O=r("p"),O.innerHTML=ct,Be=o(),$=r("details"),me=r("summary"),me.textContent=mt,Ae=J(`
As introduced in the `),ee=r("a"),ee.textContent=pt,qe=J(`, we can install the MCP toolspec with the following command:

	`),u(te.$$.fragment),ke=o(),u(le.$$.fragment),Ve=o(),u(ne.$$.fragment),Le=o(),oe=r("p"),oe.innerHTML=dt,Ee=o(),ae=r("ol"),ae.innerHTML=ut,Ne=o(),u(_.$$.fragment),Re=o(),se=r("p"),se.innerHTML=ht,Ye=o(),u(ie.$$.fragment),Xe=o(),de=r("p"),this.h()},l(e){const t=bt("svelte-u9bgzb",document.head);m=c(t,"META",{name:!0,content:!0}),t.forEach(l),s=a(e),y=c(e,"P",{}),Se(y).forEach(l),p=a(e),h(i.$$.fragment,e),b=a(e),I=c(e,"P",{"data-svelte-h":!0}),d(I)!=="svelte-1y4sc3l"&&(I.innerHTML=Ke),ue=a(e),B=c(e,"P",{"data-svelte-h":!0}),d(B)!=="svelte-jgrrn"&&(B.innerHTML=De),he=a(e),k=c(e,"P",{"data-svelte-h":!0}),d(k)!=="svelte-ir2ii4"&&(k.innerHTML=Oe),fe=a(e),V=c(e,"OL",{"data-svelte-h":!0}),d(V)!=="svelte-7bbi5a"&&(V.innerHTML=et),Me=a(e),L=c(e,"P",{"data-svelte-h":!0}),d(L)!=="svelte-1hynje"&&(L.textContent=tt),ge=a(e),h(E.$$.fragment,e),we=a(e),h(U.$$.fragment,e),ye=a(e),N=c(e,"P",{"data-svelte-h":!0}),d(N)!=="svelte-1ij77fk"&&(N.innerHTML=lt),be=a(e),h(R.$$.fragment,e),Te=a(e),h(G.$$.fragment,e),$e=a(e),h(Y.$$.fragment,e),je=a(e),X=c(e,"P",{"data-svelte-h":!0}),d(X)!=="svelte-wh1h60"&&(X.innerHTML=nt),ve=a(e),h(H.$$.fragment,e),xe=a(e),h(S.$$.fragment,e),Je=a(e),Q=c(e,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-1196szp"&&(Q.innerHTML=ot),Ze=a(e),T=c(e,"DETAILS",{});var j=Se(T);ce=c(j,"SUMMARY",{"data-svelte-h":!0}),d(ce)!=="svelte-8tnjrg"&&(ce.textContent=at),Qe=Z(j,`
As introduced in the `),F=c(j,"A",{href:!0,"data-svelte-h":!0}),d(F)!=="svelte-16phayx"&&(F.textContent=st),Fe=Z(j,`, we can install the Google toolspec with the following command:

	`),h(A.$$.fragment,j),j.forEach(l),Ce=a(e),q=c(e,"P",{"data-svelte-h":!0}),d(q)!=="svelte-a37nc2"&&(q.textContent=it),Ue=a(e),h(P.$$.fragment,e),Ge=a(e),z=c(e,"P",{"data-svelte-h":!0}),d(z)!=="svelte-piorhw"&&(z.innerHTML=rt),_e=a(e),h(K.$$.fragment,e),We=a(e),h(D.$$.fragment,e),Ie=a(e),O=c(e,"P",{"data-svelte-h":!0}),d(O)!=="svelte-k8w2vg"&&(O.innerHTML=ct),Be=a(e),$=c(e,"DETAILS",{});var v=Se($);me=c(v,"SUMMARY",{"data-svelte-h":!0}),d(me)!=="svelte-vevufv"&&(me.textContent=mt),Ae=Z(v,`
As introduced in the `),ee=c(v,"A",{href:!0,"data-svelte-h":!0}),d(ee)!=="svelte-16phayx"&&(ee.textContent=pt),qe=Z(v,`, we can install the MCP toolspec with the following command:

	`),h(te.$$.fragment,v),v.forEach(l),ke=a(e),h(le.$$.fragment,e),Ve=a(e),h(ne.$$.fragment,e),Le=a(e),oe=c(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-1s3291r"&&(oe.innerHTML=dt),Ee=a(e),ae=c(e,"OL",{"data-svelte-h":!0}),d(ae)!=="svelte-1vnf2o5"&&(ae.innerHTML=ut),Ne=a(e),h(_.$$.fragment,e),Re=a(e),se=c(e,"P",{"data-svelte-h":!0}),d(se)!=="svelte-a13dju"&&(se.innerHTML=ht),Ye=a(e),h(ie.$$.fragment,e),Xe=a(e),de=c(e,"P",{}),Se(de).forEach(l),this.h()},h(){W(m,"name","hf:doc:metadata"),W(m,"content",Jt),W(F,"href","./llama-hub"),W(ee,"href","./llama-hub")},m(e,t){x(document.head,m),n(e,s,t),n(e,y,t),n(e,p,t),f(i,e,t),n(e,b,t),n(e,I,t),n(e,ue,t),n(e,B,t),n(e,he,t),n(e,k,t),n(e,fe,t),n(e,V,t),n(e,Me,t),n(e,L,t),n(e,ge,t),f(E,e,t),n(e,we,t),f(U,e,t),n(e,ye,t),n(e,N,t),n(e,be,t),f(R,e,t),n(e,Te,t),f(G,e,t),n(e,$e,t),f(Y,e,t),n(e,je,t),n(e,X,t),n(e,ve,t),f(H,e,t),n(e,xe,t),f(S,e,t),n(e,Je,t),n(e,Q,t),n(e,Ze,t),n(e,T,t),x(T,ce),x(T,Qe),x(T,F),x(T,Fe),f(A,T,null),n(e,Ce,t),n(e,q,t),n(e,Ue,t),f(P,e,t),n(e,Ge,t),n(e,z,t),n(e,_e,t),f(K,e,t),n(e,We,t),f(D,e,t),n(e,Ie,t),n(e,O,t),n(e,Be,t),n(e,$,t),x($,me),x($,Ae),x($,ee),x($,qe),f(te,$,null),n(e,ke,t),f(le,e,t),n(e,Ve,t),f(ne,e,t),n(e,Le,t),n(e,oe,t),n(e,Ee,t),n(e,ae,t),n(e,Ne,t),f(_,e,t),n(e,Re,t),n(e,se,t),n(e,Ye,t),f(ie,e,t),n(e,Xe,t),n(e,de,t),He=!0},p(e,[t]){const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),U.$set(j);const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),G.$set(v);const ft={};t&2&&(ft.$$scope={dirty:t,ctx:e}),_.$set(ft)},i(e){He||(M(i.$$.fragment,e),M(E.$$.fragment,e),M(U.$$.fragment,e),M(R.$$.fragment,e),M(G.$$.fragment,e),M(Y.$$.fragment,e),M(H.$$.fragment,e),M(S.$$.fragment,e),M(A.$$.fragment,e),M(P.$$.fragment,e),M(K.$$.fragment,e),M(D.$$.fragment,e),M(te.$$.fragment,e),M(le.$$.fragment,e),M(ne.$$.fragment,e),M(_.$$.fragment,e),M(ie.$$.fragment,e),He=!0)},o(e){g(i.$$.fragment,e),g(E.$$.fragment,e),g(U.$$.fragment,e),g(R.$$.fragment,e),g(G.$$.fragment,e),g(Y.$$.fragment,e),g(H.$$.fragment,e),g(S.$$.fragment,e),g(A.$$.fragment,e),g(P.$$.fragment,e),g(K.$$.fragment,e),g(D.$$.fragment,e),g(te.$$.fragment,e),g(le.$$.fragment,e),g(ne.$$.fragment,e),g(_.$$.fragment,e),g(ie.$$.fragment,e),He=!1},d(e){e&&(l(s),l(y),l(p),l(b),l(I),l(ue),l(B),l(he),l(k),l(fe),l(V),l(Me),l(L),l(ge),l(we),l(ye),l(N),l(be),l(Te),l($e),l(je),l(X),l(ve),l(xe),l(Je),l(Q),l(Ze),l(T),l(Ce),l(q),l(Ue),l(Ge),l(z),l(_e),l(We),l(Ie),l(O),l(Be),l($),l(ke),l(Ve),l(Le),l(oe),l(Ee),l(ae),l(Ne),l(Re),l(se),l(Ye),l(Xe),l(de)),l(m),w(i,e),w(E,e),w(U,e),w(R,e),w(G,e),w(Y,e),w(H,e),w(S,e),w(A),w(P,e),w(K,e),w(D,e),w(te),w(le,e),w(ne,e),w(_,e),w(ie,e)}}}const Jt='{"title":"Using Tools in LlamaIndex","local":"using-tools-in-llamaindex","sections":[{"title":"Creating a FunctionTool","local":"creating-a-functiontool","sections":[],"depth":2},{"title":"Creating a QueryEngineTool","local":"creating-a-queryenginetool","sections":[],"depth":2},{"title":"Creating Toolspecs","local":"creating-toolspecs","sections":[{"title":"Model Context Protocol (MCP) in LlamaIndex","local":"model-context-protocol-mcp-in-llamaindex","sections":[],"depth":3}],"depth":2},{"title":"Utility Tools","local":"utility-tools","sections":[],"depth":2}],"depth":1}';function Zt(C){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bt extends wt{constructor(m){super(),yt(this,m,Zt,xt,Mt,{})}}export{Bt as component};
