Skip to main content

Loading the visual lab…

#tool-callingAgentic AI

Tool calling (function calling / MCP): the JSON that makes the LLM act.

What you'll play with

  1. 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.
  2. Load a ready-made scenario. Type /scenario read-file. The central JSON fills with the canonical example, the file tool lights up.
  3. Before calling, look at what the tool expects. Type /schema file. You see the properties, their types and which are required.
  4. 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).
  5. 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.
  6. 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.
  7. 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-RPC tools/call request and its result response, the very ones Claude Desktop and Cursor exchange with their MCP servers.
  8. Your turn. Try /scenario compute-power then /call calc for another tool, /example to see three payloads (one broken), /scenario web-search for a tool with an optional k field, /reset to 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).
  • /validateValidates the current JSON against the schema (without executing).
  • /strict <on|off>Enables/disables rejection of unknown properties.
  • /mcpShows the MCP (tools/call) version of the last call.
  • /exampleGives 3 payload examples for the current tool (one broken).
  • /resetResets 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 in result.content. Type /mcp to 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, path is required; in web.search, only query is (k stays optional).
payload
The JSON body sent to the tool. On MCP, it lives in params.arguments of the tools/call request. 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-loopAn agent's ReAct loop: Thought → Action → Observation, live.
  • #tool-callingTool calling (function calling / MCP): the JSON that makes the LLM act.
  • #slash-commandsSlash commands, Claude Code / Cursor style: templates, arguments, chaining.
  • #context-memoryContext window and agent memory: count, truncate, summarize, index.
  • #planning-reflectionPlanning, reflection and self-correction: from 60% to 90% success.
  • #multi-agentsMulti-agents: planner, workers, verifier. A DAG that beats the monolithic agent.