import{s as yt,o as bt,n as De}from"../chunks/scheduler.37c15a92.js";import{S as Tt,i as $t,g as r,s as o,r as d,m as J,A as jt,h as c,f as l,c as a,j as Fe,u as h,x as u,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 Ke}from"../chunks/Tip.363c041f.js";import{C as ce}from"../chunks/CodeBlock.4e987730.js";import{H as ue}from"../chunks/Heading.8ada512a.js";import{E as vt}from"../chunks/getInferenceSnippets.54ddb825.js";function xt(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}),u(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:De,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}),u(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:De,d(i){i&&(l(m),l(s),l(p))}}}function Zt(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}),u(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:De,d(p){p&&(l(m),l(s))}}}function Ct(C){let m,s,y,p,i,b,I,Oe=`<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.`,he,B,et="There are <strong>four main types of tools in LlamaIndex</strong>:",fe,k,tt='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/tools.png" alt="Tools"/>',Me,V,lt="<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>",ge,L,nt="We will go over each of them in more detail below.",we,E,ye,U,be,N,ot=`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.`,Te,R,$e,G,je,Y,ve,X,at=`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.`,xe,H,Je,S,Ze,Q,st=`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.`,Ce,T,me,it="Install the Google Toolspec",Ae,F,rt="section on the LlamaHub",qe,A,Ue,q,ct="And now we can load the toolspec and convert it to a list of tools.",Ge,P,_e,z,mt="To get a more detailed view of the tools, we can take a look at the <code>metadata</code> of each tool.",We,K,Ie,D,Be,O,pt=`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.`,ke,ee,ut='If you want to dive deeper about MCP, you can check our <a href="https://huggingface.co/learn/mcp-course/" rel="nofollow">free MCP Course</a>.',Ve,$,pe,dt="Install the MCP Toolspec",Pe,te,ht="section on the LlamaHub",ze,le,Le,ne,Ee,oe,Ne,ae,ft=`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.`,Re,se,Mt="<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>",Ye,_,Xe,ie,gt="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>",He,re,Se,de,Qe;return i=new ue({props:{title:"Using Tools in LlamaIndex",local:"using-tools-in-llamaindex",headingTag:"h1"}}),E=new ue({props:{title:"Creating a FunctionTool",local:"creating-a-functiontool",headingTag:"h2"}}),U=new Ke({props:{$$slots:{default:[xt]},$$scope:{ctx:C}}}),R=new ce({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 Ke({props:{$$slots:{default:[Jt]},$$scope:{ctx:C}}}),Y=new ue({props:{title:"Creating a QueryEngineTool",local:"creating-a-queryenginetool",headingTag:"h2"}}),H=new ce({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 ue({props:{title:"Creating Toolspecs",local:"creating-toolspecs",headingTag:"h2"}}),A=new ce({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LXRvb2xzLWdvb2dsZQ==",highlighted:"pip install llama-index-tools-google",wrap:!1}}),P=new ce({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 ce({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 ue({props:{title:"Model Context Protocol (MCP) in LlamaIndex",local:"model-context-protocol-mcp-in-llamaindex",headingTag:"h3"}}),le=new ce({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LXRvb2xzLW1jcA==",highlighted:"pip install llama-index-tools-mcp",wrap:!1}}),ne=new ce({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}}),oe=new ue({props:{title:"Utility Tools",local:"utility-tools",headingTag:"h2"}}),_=new Ke({props:{$$slots:{default:[Zt]},$$scope:{ctx:C}}}),re=new vt({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(),d(i.$$.fragment),b=o(),I=r("p"),I.innerHTML=Oe,he=o(),B=r("p"),B.innerHTML=et,fe=o(),k=r("p"),k.innerHTML=tt,Me=o(),V=r("ol"),V.innerHTML=lt,ge=o(),L=r("p"),L.textContent=nt,we=o(),d(E.$$.fragment),ye=o(),d(U.$$.fragment),be=o(),N=r("p"),N.innerHTML=ot,Te=o(),d(R.$$.fragment),$e=o(),d(G.$$.fragment),je=o(),d(Y.$$.fragment),ve=o(),X=r("p"),X.innerHTML=at,xe=o(),d(H.$$.fragment),Je=o(),d(S.$$.fragment),Ze=o(),Q=r("p"),Q.innerHTML=st,Ce=o(),T=r("details"),me=r("summary"),me.textContent=it,Ae=J(`
As introduced in the `),F=r("a"),F.textContent=rt,qe=J(`, we can install the Google toolspec with the following command:

	`),d(A.$$.fragment),Ue=o(),q=r("p"),q.textContent=ct,Ge=o(),d(P.$$.fragment),_e=o(),z=r("p"),z.innerHTML=mt,We=o(),d(K.$$.fragment),Ie=o(),d(D.$$.fragment),Be=o(),O=r("p"),O.innerHTML=pt,ke=o(),ee=r("p"),ee.innerHTML=ut,Ve=o(),$=r("details"),pe=r("summary"),pe.textContent=dt,Pe=J(`
As introduced in the `),te=r("a"),te.textContent=ht,ze=J(`, we can install the MCP toolspec with the following command:

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

	`),h(A.$$.fragment,j),j.forEach(l),Ue=a(e),q=c(e,"P",{"data-svelte-h":!0}),u(q)!=="svelte-a37nc2"&&(q.textContent=ct),Ge=a(e),h(P.$$.fragment,e),_e=a(e),z=c(e,"P",{"data-svelte-h":!0}),u(z)!=="svelte-piorhw"&&(z.innerHTML=mt),We=a(e),h(K.$$.fragment,e),Ie=a(e),h(D.$$.fragment,e),Be=a(e),O=c(e,"P",{"data-svelte-h":!0}),u(O)!=="svelte-k8w2vg"&&(O.innerHTML=pt),ke=a(e),ee=c(e,"P",{"data-svelte-h":!0}),u(ee)!=="svelte-ki6njs"&&(ee.innerHTML=ut),Ve=a(e),$=c(e,"DETAILS",{});var v=Fe($);pe=c(v,"SUMMARY",{"data-svelte-h":!0}),u(pe)!=="svelte-vevufv"&&(pe.textContent=dt),Pe=Z(v,`
As introduced in the `),te=c(v,"A",{href:!0,"data-svelte-h":!0}),u(te)!=="svelte-16phayx"&&(te.textContent=ht),ze=Z(v,`, we can install the MCP toolspec with the following command:

	`),h(le.$$.fragment,v),v.forEach(l),Le=a(e),h(ne.$$.fragment,e),Ee=a(e),h(oe.$$.fragment,e),Ne=a(e),ae=c(e,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-1s3291r"&&(ae.innerHTML=ft),Re=a(e),se=c(e,"OL",{"data-svelte-h":!0}),u(se)!=="svelte-1vnf2o5"&&(se.innerHTML=Mt),Ye=a(e),h(_.$$.fragment,e),Xe=a(e),ie=c(e,"P",{"data-svelte-h":!0}),u(ie)!=="svelte-a13dju"&&(ie.innerHTML=gt),He=a(e),h(re.$$.fragment,e),Se=a(e),de=c(e,"P",{}),Fe(de).forEach(l),this.h()},h(){W(m,"name","hf:doc:metadata"),W(m,"content",Ut),W(F,"href","./llama-hub"),W(te,"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,he,t),n(e,B,t),n(e,fe,t),n(e,k,t),n(e,Me,t),n(e,V,t),n(e,ge,t),n(e,L,t),n(e,we,t),f(E,e,t),n(e,ye,t),f(U,e,t),n(e,be,t),n(e,N,t),n(e,Te,t),f(R,e,t),n(e,$e,t),f(G,e,t),n(e,je,t),f(Y,e,t),n(e,ve,t),n(e,X,t),n(e,xe,t),f(H,e,t),n(e,Je,t),f(S,e,t),n(e,Ze,t),n(e,Q,t),n(e,Ce,t),n(e,T,t),x(T,me),x(T,Ae),x(T,F),x(T,qe),f(A,T,null),n(e,Ue,t),n(e,q,t),n(e,Ge,t),f(P,e,t),n(e,_e,t),n(e,z,t),n(e,We,t),f(K,e,t),n(e,Ie,t),f(D,e,t),n(e,Be,t),n(e,O,t),n(e,ke,t),n(e,ee,t),n(e,Ve,t),n(e,$,t),x($,pe),x($,Pe),x($,te),x($,ze),f(le,$,null),n(e,Le,t),f(ne,e,t),n(e,Ee,t),f(oe,e,t),n(e,Ne,t),n(e,ae,t),n(e,Re,t),n(e,se,t),n(e,Ye,t),f(_,e,t),n(e,Xe,t),n(e,ie,t),n(e,He,t),f(re,e,t),n(e,Se,t),n(e,de,t),Qe=!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 wt={};t&2&&(wt.$$scope={dirty:t,ctx:e}),_.$set(wt)},i(e){Qe||(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(le.$$.fragment,e),M(ne.$$.fragment,e),M(oe.$$.fragment,e),M(_.$$.fragment,e),M(re.$$.fragment,e),Qe=!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(le.$$.fragment,e),g(ne.$$.fragment,e),g(oe.$$.fragment,e),g(_.$$.fragment,e),g(re.$$.fragment,e),Qe=!1},d(e){e&&(l(s),l(y),l(p),l(b),l(I),l(he),l(B),l(fe),l(k),l(Me),l(V),l(ge),l(L),l(we),l(ye),l(be),l(N),l(Te),l($e),l(je),l(ve),l(X),l(xe),l(Je),l(Ze),l(Q),l(Ce),l(T),l(Ue),l(q),l(Ge),l(_e),l(z),l(We),l(Ie),l(Be),l(O),l(ke),l(ee),l(Ve),l($),l(Le),l(Ee),l(Ne),l(ae),l(Re),l(se),l(Ye),l(Xe),l(ie),l(He),l(Se),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(le),w(ne,e),w(oe,e),w(_,e),w(re,e)}}}const Ut='{"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 Gt(C){return bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends Tt{constructor(m){super(),$t(this,m,Gt,Ct,yt,{})}}export{Lt as component};
