Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Building MCP Servers

Free · sign in to start and track progress

1 · The protocol and its mental model

  • 1MCP and REST: two mental models
  • 2The protocol on the wire

2 · Designing servers agents use well

  • 3Designing tools, not endpoints

    Exercise answers

    • Answer: Build the designed larchmere-desk server
    • Answer: Add response_format to search_tickets and measure it
  • 4Testing and evaluating servers
  • 5Resources, prompts and asking for input

3 · Running servers in production

  • 6Remote servers and authorization
  • 7Securing MCP servers
  • 8Shipping and evolving servers
CapstoneShip an MCP server for an existing REST APIReference implementation

Module 2 · Designing servers agents use well · Lesson 3

Designing tools, not endpoints

Turn an endpoint-per-tool server into a few task-shaped tools a model uses well, with names, schemas, structured results, errors and annotations designed for a reader that decides at run time.

60 min 2 videos 3 exercises 8-question quiz Answers
Setup for the exercises:Install Claude CodeNode.js, pnpm and TypeScriptMCP servers in Claude CodeThe Larchmere Desk mock API

By the end of this lesson you can

  • Redesign an endpoint-per-tool server into task-shaped tools by consolidating reads and splitting writes by their consequence
  • Write names, descriptions, server instructions and input schemas around what a model knows when it makes a call
  • Return compact structured results, and weigh what an output schema adds to the definitions against what it buys
  • Turn failures into protocol errors or tool execution errors whose text tells a model how to recover
  • Choose tool annotations by comparison with HTTP's safe and idempotent methods, and explain why they stay hints

On this page

  • Who reads a tool definition
  • From fourteen endpoints to seven tools
  • Names, descriptions and instructions
  • Input schemas: design for what the model knows
  • Results: structured, compact and sized
  • Errors written for recovery
  • Annotations, and HTTP's safe and idempotent methods
  • State as explicit handles
  • When tools multiply
  • The redesign in numbers
  • Misconceptions and limits
  • How this sets up the next lesson
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Who reads a tool definition
  2. 02From fourteen endpoints to seven tools
  3. 03Names, descriptions and instructions
  4. 04Input schemas: design for what the model knows
  5. 05Results: structured, compact and sized
  6. 06Errors written for recovery
  7. 07Annotations, and HTTP's safe and idempotent methods
  8. 08State as explicit handles
  9. 09When tools multiply
  10. 10The redesign in numbers
  11. 11Misconceptions and limits
  12. 12How this sets up the next lesson
  13. 13Summary

Sources & further reading

  • Model Context Protocol (MCP) Tool Descriptions Are Smelly! Towards Improving AI Agent Efficiency with Augmented MCP Tool DescriptionsPaper · Mohammed Mehedi Hasan, Hao Li, Gopi Krishnan Rajbahadur, Bram Adams, Ahmed E. Hassan · 2026856 tools on 103 servers: 97.1% of descriptions have a smell, and fixing them helps but costs steps. Read the six-component rubric and the ablation that keeps compact descriptions.
  • Which Metadata Matters for LLM Tool Selection in MCP? Evidence from Controlled Factor-Level InterventionsPaper · Xiaofan Li, Fengchun Qiao, Xing Gao · 2026
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 13 more sections
  • 3 hands-on exercises
  • A 8-question quiz
  • Progress, quiz scores and bookmarks
A very recent preprint: changing one metadata factor at a time, parameter schemas moved tool selection most, and models favoured separate top-level parameters over grouped ones. Read the findings list in the abstract and introduction.
  • RAG-MCP: Mitigating Prompt Bloat in LLM Tool Selection via Retrieval-Augmented GenerationPaper · Tiantian Gan, Qiyao Sun · 2025What many tool definitions cost: retrieving only the relevant ones cut prompt tokens by over half and tripled selection accuracy. Read the MCP stress test.
  • Writing effective tools for agents — with agentsLab research · Anthropic · 2025The design principles this lesson applies to MCP. Read "Choosing the right tools for agents", "Returning meaningful context" (the response_format example) and "Optimizing tool responses for token efficiency" (truncation and error messages).
  • Code execution with MCP: Building more efficient agentsLab research · Anthropic · 2025Why loading every definition and passing every intermediate result through the model doesn't scale, and the alternative of presenting MCP servers as code. Read the first two sections and the caveats.
  • Tools (specification 2026-07-28)Docs · Model Context Protocol · 2026The normative rules for tool names, input and output schemas, structured content, the two kinds of error and annotations, plus the non-normative guidance on stateful tools.
  • RFC 9110: HTTP Semantics, section 9.2Docs · IETF · 2022Safe and idempotent methods, the REST side of the annotations comparison. Ten minutes for 9.2.1 and 9.2.2.