#tool-calling — Agentic AI
Tool calling (function calling / MCP): the JSON that makes the LLM act.
What you'll play with
- Welcome to #tool-calling. On the left, the indigo bubble is the LLM. On the right, four tools: 📄 file, 🧮 calc, 🌐 web, 💾 db. In the middle, a JSON block. When you tell Claude Code "read
config.json", the model reads nothing itself: it writes a JSON{ "name": "file.read", "arguments": { "path": "config.json" } }that a runtime validates against a schema, executes, then returns an observation. That is function calling. Let us run it by hand. - Load a ready-made scenario. Type
/scenario read-file. The central JSON fills with the canonical example, the file tool lights up. - Before calling, look at what the tool expects. Type
/schema file. You see the properties, their types and which are required. - Take action:
/call file. The central JSON is validated (VALIDATED ✓ banner), a green arrow leaves the LLM towards the 📄 tool which lights up, a gold arrow brings back the observation (the file contents). - Deliberately break the arguments to see validation refuse:
/args {"path": 42}. The central JSON updates with this new value, but no execution: you must validate. - Second safeguard: strict mode, which rejects unknown properties. Turn it on:
/strict on. Then retype/args {"path": "a.txt", "extra": true}and/validate: the banner turns red, the extra property is refused whereas it would be tolerated outside strict mode. - Finally, look at what the same call looks like on the MCP side (Model Context Protocol, standardised by Anthropic in 2024). Type
/mcp: you will see the JSON-RPCtools/callrequest and itsresultresponse, the very ones Claude Desktop and Cursor exchange with their MCP servers. - Your turn. Try
/scenario compute-powerthen/call calcfor another tool,/exampleto see three payloads (one broken),/scenario web-searchfor a tool with an optionalkfield,/resetto start over. Next: #slash-commands (Premium) shows how these calls get wrapped into/plan,/review… shortcuts; #react-loop shows how several calls chain into Thought → Action → Observation.
Channel commands
/scenario <read-file|compute-power|web-search|db-query>— Loads a ready-made scenario (tool + example JSON + observation)./call <file|calc|web|db>— Emits the expected JSON, validates then executes (scripted observation)./schema <file|calc|web|db>— Displays the JSON schema expected by a tool (without executing)./args <json>— Replaces the arguments of the next call (raw JSON)./validate— Validates the current JSON against the schema (without executing)./strict <on|off>— Enables/disables rejection of unknown properties./mcp— Shows the MCP (tools/call) version of the last call./example— Gives 3 payload examples for the current tool (one broken)./reset— Resets the channel: no tool, no JSON, no history.
Glossary
- function calling
- Pattern where the LLM emits a structured JSON containing a tool name and its arguments. A runtime validates that JSON against a schema, executes the matching function and returns an observation to the model. Standardised by OpenAI (tools), Anthropic (tool use) and by the MCP protocol.
- JSON schema
- Contract that describes the shape of the arguments expected by a tool: property names, types (
string,number,array…), required properties. The runtime rejects any non-compliant payload before ever touching the tool. - strict validation
- Option that rejects any property not declared in the schema. Without it, the LLM can invent fields (
encoding,timeout…) that the tool will silently ignore. Claude Code and Cursor require strict mode by default. - MCP
- Open protocol (Anthropic, 2024) that standardises how a client (Claude Desktop, Cursor…) talks to a tool server (files, git, Notion…). It is function calling wrapped in JSON-RPC 2.0.
- tools/call
- The JSON-RPC method that an MCP client invokes to execute a tool:
{"method": "tools/call", "params": {"name": "…", "arguments": {…}}}. The server responds inresult.content. Type/mcpto see a full example. - typed observation
- Return from a tool (string, JSON, error) that the LLM re-reads on the next iteration. The "typed" part comes from the fact that the content is structured (JSON), not just free text — the model can re-parse it.
- required property
- A property marked as mandatory in the schema: its absence triggers an immediate rejection, before validation of the other fields. In
file.read,pathis required; inweb.search, onlyqueryis (kstays optional). - payload
- The JSON body sent to the tool. On MCP, it lives in
params.argumentsof thetools/callrequest. That is exactly what the central 3D card displays. - retry
- When validation refuses a payload, the LLM receives the error as an observation and re-generates a corrected JSON. A good runtime caps the number of retries (2–5) and forwards the error in natural language to help the model.
- slash command
- User shortcut (
/plan,/review…) that triggers a mini agent workflow — often a sequence of tool calls. Detailed in #slash-commands (Premium).
Other channels in Agentic AI
- #react-loop — An agent's ReAct loop: Thought → Action → Observation, live.
- #tool-calling — Tool calling (function calling / MCP): the JSON that makes the LLM act.
- #slash-commands — Slash commands, Claude Code / Cursor style: templates, arguments, chaining.
- #context-memory — Context window and agent memory: count, truncate, summarize, index.
- #planning-reflection — Planning, reflection and self-correction: from 60% to 90% success.
- #multi-agents — Multi-agents: planner, workers, verifier. A DAG that beats the monolithic agent.