A schema makes expectations about data explicit. In agent workflows, typed input/output schemas avoid brittle string parsing. For MCP tools, the function signature defines parameters, the docstring describes when to call the tool, and return annotations indicate the expected result shape. section 2.6 section 3.2.1
Listing 3.1 01_claude_mcp_server.py
from mcp.server.fastmcp import FastMCP
# Create an MCP server
mcp = FastMCP("Research Tools") #1
@mcp.tool() #2
def get_research_sources() -> list[str]:
"""Provides a list of research sources."""
search_sources = [
"Wikipedia",
"Google",
"YouTube",
]
return search_sources
This minimal Python MCP server shows a tool whose return annotation and docstring contribute to its schema. section 3.2.1











































