Stage 6: Build + Test
Duration: ~15 minutes
What happens: AgentSherpa generates the server code, installs dependencies, and tests each tool with live data.
What gets built
AgentSherpa creates three files in your workspace:
server.py
The MCP server using the Python SDK v2 (mcp package):
-
MCPServerinstance frommcp.serverwith dual-transport support (stdio + streamable HTTP) -
One
@server.tool(name=…, description=…)function per approved tool -
yfinancelibrary for Yahoo Finance data access -
Python type hints that map to JSON Schema, docstrings, and try/except error handling
Testing
AgentSherpa tests each tool live:
-
Installs
yfinanceandmcp[cli]in the workspace -
Runs the tool function directly (not through the server) with a real ticker like
AAPL -
Shows the output so you can verify the data looks correct
-
Moves to the next tool only after confirming success
For tools that return market data, results depend on market hours. The agent handles this gracefully — if a market is closed, it shows the last available data.
What to watch for
-
Type errors — the agent should use proper Python types, not raw strings
-
Missing error handling — what happens with an invalid ticker like
XYZNOTREAL? -
Tool descriptions — are they clear enough for an LLM to decide when to use them?
If you spot issues, tell AgentSherpa. It will fix and re-test.