Agentic AI Notebook
Model Context Protocol
Phase 8Module 6 of 25

Tools

Function calling was reinvented in every framework. MCP tools are the same idea, with one discovery story for every client.

A tool is a labeled button on a machine. The label (description) is what the operator reads before pressing it.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

Overview

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

GitHub example

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

search_code is a tool. The repo README would be a resource.

Key Takeaways

  • 1.MCP tools are actions with a name, description, and JSON Schema. The LLM picks a tool from the description, not from your Python name.
  • 2.call_tool sends arguments; the server returns CallToolResult content. One MCP tool works in Cursor, Claude Desktop, and your custom agent.
  • 3.Treat descriptions as UI copy for the model. If two tools sound the same, the model will flip a coin.
  • 4.Namespace tools when you attach several servers (github/search_code).

Learn elsewhere

  • Resources vs tools — previous module
  • Routing tools in an agent — Integrate MCP with Agent

Real Example

Scenario

A GitHub MCP server exposes create_issue, search_code, and get_pull_request. Cursor's agent calls search_code, then opens an issue with create_issue.

What you would do

In Model Context Protocol, apply Tools to this scenario: A GitHub MCP server exposes create_issue, search_code, and get_pull_request. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • Tool = name + description + inputSchema
  • call_tool(name, arguments)
  • Description is the LLM's instruction manual
  • Namespace tools when many servers overlap

Cheat Sheet

Quick recap

quick ref
  • Tools are verbs / actions
  • JSON Schema for arguments
  • Honest descriptions prevent wrong calls
  • Return errors as results, keep the process up

Common Mistakes

  • Two tools with almost the same description
  • Optional arguments that are actually required
  • A mega-tool that does five unrelated jobs