[{"data":1,"prerenderedAt":731},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fai-tools":135,"\u002Fdocs\u002Fai-tools-surround":727},[4],{"title":5,"path":6,"stem":7,"children":8,"page":134},"Docs","\u002Fdocs","docs",[9,13,17,21,25,29,33,37,41,45,49,53,57,61,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130],{"title":10,"path":11,"stem":12},"AI harnesses: LLM tools, MCP servers and agents","\u002Fdocs\u002Fai-tools","docs\u002Fai-tools",{"title":14,"path":15,"stem":16},"Architecture","\u002Fdocs\u002Farchitecture","docs\u002Farchitecture",{"title":18,"path":19,"stem":20},"Web \u002F native bridges","\u002Fdocs\u002Fbridges","docs\u002Fbridges",{"title":22,"path":23,"stem":24},"Broadcast channels and tests","\u002Fdocs\u002Fchannels-and-tests","docs\u002Fchannels-and-tests",{"title":26,"path":27,"stem":28},"CLI reference","\u002Fdocs\u002Fcli","docs\u002Fcli",{"title":30,"path":31,"stem":32},"Completeness: how far an answer reaches","\u002Fdocs\u002Fcompleteness","docs\u002Fcompleteness",{"title":34,"path":35,"stem":36},"Configuration","\u002Fdocs\u002Fconfiguration","docs\u002Fconfiguration",{"title":38,"path":39,"stem":40},"External systems","\u002Fdocs\u002Fexternal","docs\u002Fexternal",{"title":42,"path":43,"stem":44},"Generated, copied and vendored files","\u002Fdocs\u002Fgenerated","docs\u002Fgenerated",{"title":46,"path":47,"stem":48},"Installing and updating cg","\u002Fdocs\u002Finstall","docs\u002Finstall",{"title":50,"path":51,"stem":52},"Java","\u002Fdocs\u002Fjava","docs\u002Fjava",{"title":54,"path":55,"stem":56},"Kotlin","\u002Fdocs\u002Fkotlin","docs\u002Fkotlin",{"title":58,"path":59,"stem":60},"Known limitations","\u002Fdocs\u002Flimitations","docs\u002Flimitations",{"title":62,"path":63,"stem":64,"children":65},"MCP server","\u002Fdocs\u002Fmcp","docs\u002Fmcp",[66],{"title":67,"path":68,"stem":69},"code-graph MCP: sample outputs (real calls via the MCP Python SDK stdio client)","\u002Fdocs\u002Fmcp\u002Fsample_outputs","docs\u002Fmcp\u002Fsample_outputs",{"title":71,"path":72,"stem":73},"Rust, C and C++","\u002Fdocs\u002Fnative","docs\u002Fnative",{"title":75,"path":76,"stem":77},"Port gaps: cg parity","\u002Fdocs\u002Fparity","docs\u002Fparity",{"title":79,"path":80,"stem":81},"PHP","\u002Fdocs\u002Fphp","docs\u002Fphp",{"title":83,"path":84,"stem":85},"Planned changes","\u002Fdocs\u002Fplans","docs\u002Fplans",{"title":87,"path":88,"stem":89},"Platform-specific code","\u002Fdocs\u002Fplatforms","docs\u002Fplatforms",{"title":91,"path":92,"stem":93},"Protocol links","\u002Fdocs\u002Fprotocols","docs\u002Fprotocols",{"title":95,"path":96,"stem":97},"Python","\u002Fdocs\u002Fpython","docs\u002Fpython",{"title":99,"path":100,"stem":101},"Quick start","\u002Fdocs\u002Fquickstart","docs\u002Fquickstart",{"title":103,"path":104,"stem":105},"Graph schema","\u002Fdocs\u002Fschema","docs\u002Fschema",{"title":107,"path":108,"stem":109},"Attack surface","\u002Fdocs\u002Fsurface","docs\u002Fsurface",{"title":111,"path":112,"stem":113},"Swift","\u002Fdocs\u002Fswift","docs\u002Fswift",{"title":115,"path":116,"stem":117},"TypeScript \u002F JavaScript frameworks","\u002Fdocs\u002Fts-frameworks","docs\u002Fts-frameworks",{"title":119,"path":120,"stem":121},"How we validate","\u002Fdocs\u002Fvalidation","docs\u002Fvalidation",{"title":123,"path":124,"stem":125},"Validation log","\u002Fdocs\u002Fvalidation-log","docs\u002Fvalidation-log",{"title":127,"path":128,"stem":129},"Value facts and resolutions","\u002Fdocs\u002Fvalue-facts","docs\u002Fvalue-facts",{"title":131,"path":132,"stem":133},"Visual view","\u002Fdocs\u002Fviz","docs\u002Fviz",false,{"id":136,"title":10,"body":137,"description":721,"extension":722,"meta":723,"navigation":724,"path":11,"seo":725,"stem":12,"__hash__":726},"docs\u002Fdocs\u002Fai-tools.md",{"type":138,"value":139,"toc":717},"minimark",[140,149,160,171,396,437,534,545,610,630,657,662,706,713],[141,142,143,144,148],"p",{},"A tool is registered under a name and a harness dispatches to the handler. There is no call edge\nin the code, so cg models the tool as a ",[145,146,147],"a",{"href":92},"protocol endpoint",":",[150,151,156],"pre",{"className":152,"code":154,"language":155},[153],"language-text","agent \u002F MCP client -SENDS_TO-> endpoint:llm_tool:\u003Cname> | endpoint:mcp_tool:\u003Cserver>\u002F\u003Cname> -RECEIVED_BY-> handler\nagent:\u003Cname> -OFFERS_TOOL-> tool;  agent -HANDS_OFF_TO-> agent\n","text",[157,158,154],"code",{"__ignoreMap":159},"",[141,161,162,163,166,167,170],{},"A receiving tool is an entry point of kind ",[157,164,165],{},"llm_tool",". Only modules that import an AI SDK are\nread (Python: mcp, fastmcp, openai, agents, anthropic, langchain, langgraph, llama_index;\nTypeScript: ",[157,168,169],{},"@modelcontextprotocol\u002Fsdk",").",[172,173,174,190],"table",{},[175,176,177],"thead",{},[178,179,180,184,187],"tr",{},[181,182,183],"th",{},"framework",[181,185,186],{},"receiver",[181,188,189],{},"sender",[191,192,193,224,248,275,298,312,331,364,379],"tbody",{},[178,194,195,202,219],{},[196,197,198,199],"td",{},"FastMCP \u002F ",[157,200,201],{},"MCPServer",[196,203,204,207,208,207,211,214,215,218],{},[157,205,206],{},"@mcp.tool"," \u002F ",[157,209,210],{},".resource",[157,212,213],{},".prompt",", ",[157,216,217],{},"add_tool(fn)",". A server built inside a function: the enclosing function is the receiver",[196,220,221],{},[157,222,223],{},"mcp.run()",[178,225,226,232,246],{},[196,227,228,229],{},"MCP ",[157,230,231],{},"Server",[196,233,234,237,238,241,242,245],{},[157,235,236],{},"@server.call_tool()"," branching on ",[157,239,240],{},"name == \"x\""," or an enum member. One ",[157,243,244],{},"Tool(name=)"," and no branch maps that tool to the whole handler",[196,247],{},[178,249,250,255,273],{},[196,251,252,253],{},"TS ",[157,254,169],{},[196,256,257,207,260,207,263,207,266,269,270],{},[157,258,259],{},"registerTool",[157,261,262],{},"tool",[157,264,265],{},"registerPrompt",[157,267,268],{},"registerResource"," on ",[157,271,272],{},"new McpServer({name})",[196,274],{},[178,276,277,280,282],{},[196,278,279],{},"MCP clients",[196,281],{},[196,283,284,207,287,207,290,293,294,297],{},[157,285,286],{},"session.call_tool",[157,288,289],{},"read_resource",[157,291,292],{},"get_prompt"," (MATCHES_ENDPOINT, including ",[157,295,296],{},"cg link",")",[178,299,300,303,305],{},[196,301,302],{},"OpenAI \u002F Anthropic",[196,304],{},[196,306,307,308,311],{},"a ",[157,309,310],{},"tools="," schema literal or a module constant",[178,313,314,317,322],{},[196,315,316],{},"OpenAI Agents",[196,318,319],{},[157,320,321],{},"@function_tool",[196,323,324,327,328],{},[157,325,326],{},"Agent(name=, tools=, handoffs=)"," → ",[157,329,330],{},"agent:\u003Cname>",[178,332,333,336,350],{},[196,334,335],{},"LangChain",[196,337,338,214,341,214,344,327,347],{},[157,339,340],{},"@tool",[157,342,343],{},"StructuredTool.from_function",[157,345,346],{},"BaseTool.name",[157,348,349],{},"_run",[196,351,352,214,355,214,358,214,361],{},[157,353,354],{},"bind_tools",[157,356,357],{},"create_react_agent",[157,359,360],{},"AgentExecutor",[157,362,363],{},"ToolNode",[178,365,366,369,374],{},[196,367,368],{},"LlamaIndex",[196,370,371],{},[157,372,373],{},"FunctionTool.from_defaults",[196,375,376,377],{},"constructors with ",[157,378,310],{},[178,380,381,384,393],{},[196,382,383],{},"Hand-written loops",[196,385,386,214,389,392],{},[157,387,388],{},"TOOLS = {\"x\": fn}",[157,390,391],{},"if name == \"x\""," in a function that handles tool calls",[196,394,395],{},"the schema list",[141,397,398,399,214,401,404,405,214,408,411,412,214,415,214,418,421,422,214,425,428,429,432,433,436],{},"Endpoint attrs: ",[157,400,183],{},[157,402,403],{},"description"," (first docstring line), ",[157,406,407],{},"params",[157,409,410],{},"schema_source","\n(decorator, constructor, class attrs, dict registry, agent loop, schema literal, low-level\nserver), ",[157,413,414],{},"declared_in",[157,416,417],{},"toolset",[157,419,420],{},"server",". An unnamed local server is named after the\nfunction that builds it (",[157,423,424],{},"nested_in",[157,426,427],{},"handler_name","). A TS handler is the inline arrow (a\nfunction node ",[157,430,431],{},"server.registerTool('x')",") or the function passed. A ",[157,434,435],{},"server: McpServer","\nparameter of a register helper uses the package's one named server.",[141,438,439,440,214,443,446,447,450,451,454,455,458,459,462,463,466,467,214,470,214,473,476,477,480,481,214,484,214,487,490,491,494,495,214,498,214,501,214,504,214,507,510,511,513,514,517,518,521,522,525,526,529,530,533],{},"A loop that picks the handler with ",[157,441,442],{},"globals()[name]",[157,444,445],{},"getattr"," or ",[157,448,449],{},"eval"," is recorded as\n",[157,452,453],{},"attrs.llm_dynamic_dispatch"," and listed by ",[157,456,457],{},"cg tools",". It is never linked. Literal ",[157,460,461],{},"model="," \u002F\n",[157,464,465],{},"base_url="," of ",[157,468,469],{},"chat.completions.create",[157,471,472],{},"responses.create",[157,474,475],{},"messages.create",",\n",[157,478,479],{},"embeddings.create"," and of constructors (",[157,482,483],{},"ChatOpenAI",[157,485,486],{},"OpenAI(base_url=)",[157,488,489],{},"init_chat_model",") are ",[157,492,493],{},"attrs.llm_calls"," (",[157,496,497],{},"provider",[157,499,500],{},"op",[157,502,503],{},"model",[157,505,506],{},"base_url",[157,508,509],{},"line",") on the calling\nfunction. Those facts feed the external nodes in ",[145,512,38],{"href":39},". Confidence is\n",[157,515,516],{},"exact"," for a literal name, ",[157,519,520],{},"resolved"," through a wrapper or a module constant, ",[157,523,524],{},"heuristic"," when\na ",[157,527,528],{},"BaseTool"," subclass has no literal ",[157,531,532],{},"name"," (the class name is used).",[141,535,536,537,540,541,544],{},"cg's own server (",[157,538,539],{},"cg_code_graph\u002Fmcp_server.py",") indexes as ",[157,542,543],{},"endpoint:mcp_tool:code-graph\u002F\u003Ctool>",".\nThe decorator's reference edge is replaced by that endpoint.",[150,546,550],{"className":547,"code":548,"language":549,"meta":159,"style":159},"language-bash shiki shiki-themes cg-light cg-light cg-dark","cg tools --db graph.db\ncg tools refund --framework mcp --unmatched --db graph.db\ncg tools --agent Billing --db graph.db\n","bash",[157,551,552,570,593],{"__ignoreMap":159},[553,554,556,560,564,567],"span",{"class":509,"line":555},1,[553,557,559],{"class":558},"sZJo5","cg",[553,561,563],{"class":562},"sha9Y"," tools",[553,565,566],{"class":562}," --db",[553,568,569],{"class":562}," graph.db\n",[553,571,573,575,577,580,583,586,589,591],{"class":509,"line":572},2,[553,574,559],{"class":558},[553,576,563],{"class":562},[553,578,579],{"class":562}," refund",[553,581,582],{"class":562}," --framework",[553,584,585],{"class":562}," mcp",[553,587,588],{"class":562}," --unmatched",[553,590,566],{"class":562},[553,592,569],{"class":562},[553,594,596,598,600,603,606,608],{"class":509,"line":595},3,[553,597,559],{"class":558},[553,599,563],{"class":562},[553,601,602],{"class":562}," --agent",[553,604,605],{"class":562}," Billing",[553,607,566],{"class":562},[553,609,569],{"class":562},[141,611,612,613,617,618,621,622,625,626,629],{},"Checks are the ",[145,614,616],{"href":615},"\u002Fdocs\u002Fprotocols#checks","protocol checks"," plus ",[157,619,620],{},"name_collision"," (two handlers, one\nname, one module). ",[157,623,624],{},"tables"," lists tables the handler reads or writes within three calls. MCP:\n",[157,627,628],{},"llm_tools(pattern?, framework?, unmatched?, agent?)",".",[141,631,632,635,636,639,640,214,643,214,646,214,649,652,653,656],{},[157,633,634],{},"cg tools refund"," prints one block: handler, who offers or calls it, matches, agents, and the\ntables it reaches. ",[157,637,638],{},"cg protocols --protocol llm_tool|mcp_tool|mcp_resource|mcp_prompt"," shows the\nsame endpoints. ",[157,641,642],{},"impact",[157,644,645],{},"tests",[157,647,648],{},"reaches",[157,650,651],{},"path"," and ",[157,654,655],{},"downstream"," follow SENDS_TO \u002F\nRECEIVED_BY \u002F MATCHES_ENDPOINT \u002F OFFERS_TOOL with no extra flags.",[658,659,661],"h2",{"id":660},"not-covered-yet","Not covered yet",[663,664,665,677,693],"ul",{},[666,667,668,669,672,673,676],"li",{},"TypeScript MCP clients, low-level ",[157,670,671],{},"setRequestHandler",", Vercel AI SDK ",[157,674,675],{},"tool()",", OpenAI \u002F\nAnthropic Node schema literals.",[666,678,679,680,652,683,214,686,214,689,692],{},"LangGraph edges, LlamaIndex ",[157,681,682],{},"QueryEngineTool",[157,684,685],{},"@step",[157,687,688],{},"Runner.run",[157,690,691],{},"agent.as_tool()",",\nMCP servers attached to agents.",[666,694,695,697,698,701,702,705],{},[157,696,321],{}," on a nested function (no handler node). ",[157,699,700],{},"USES_MODEL"," edges to ",[157,703,704],{},"external:llm:","\nnodes.",[141,707,708,709,629],{},"Public harnesses:\n",[145,710,712],{"href":711},"\u002Fdocs\u002Fvalidation-log#ai-harnesses-llm-tools-mcp-servers-and-agents-66","AI harnesses",[714,715,716],"style",{},"html pre.shiki code .sZJo5, html code.shiki .sZJo5{--shiki-light:#65A30D;--shiki-default:#65A30D;--shiki-dark:#84CC16}html pre.shiki code .sha9Y, html code.shiki .sha9Y{--shiki-light:#9F8CFF;--shiki-default:#9F8CFF;--shiki-dark:#C4B5FD}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":159,"searchDepth":718,"depth":572,"links":719},4,[720],{"id":660,"depth":572,"text":661},"A tool is registered under a name and a harness dispatches to the handler. There is no call edge\nin the code, so cg models the tool as a protocol endpoint:","md",{},true,{"title":10,"description":721},"Tp_q6N_8eAznk5EPZgxXZu8zcfwGVRbNOgFG-zY2-xU",[728,729],null,{"title":14,"path":15,"stem":16,"description":730,"children":-1},"An index is a deterministic graph in SQLite. Queries, MCP, and the visual view read that graph.\nWhat each language extracts lives on its own page. This page is the pipeline and the rules every plugin shares.",1792170237176]