Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
1.8 KiB
1.8 KiB
description
| description |
|---|
| Add a new MCP tool to the Teamlandkarte server following established patterns. |
$ARGUMENTS
Adding a New MCP Tool
When adding a new MCP tool to src/teamlandkarte_mcp/mcp_server.py, follow these patterns:
Naming Convention
- Use
verb_nounpattern (e.g.,find_matching_capacities,get_task_details,list_open_tasks) - Prefix with
mcp_in the function name for the decorator
Required Structure
- Define the tool function with
@mcp.tool()decorator - Add clear parameter schemas with descriptions and types
- Return Markdown-formatted output (tables for structured data)
- Include proper error messages for invalid inputs
- Produce deterministic outputs (same input → same output, modulo cache)
Checklist
- Tool function defined in
mcp_server.pywith@mcp.tool()decorator - Parameters have type hints and descriptions
- Output uses Markdown tables for structured data
- Error handling for invalid inputs (return helpful error messages)
- No secrets or credentials in output
- Read-only database access (never write to Trino)
- Add corresponding test in
tests/ - Run
uv run ruff check src/ tests/anduv run mypy src/ - Update
docs/assistant_system_prompt.mdwith the new tool documentation
Example Pattern
@mcp.tool()
async def mcp_my_new_tool(
param1: str,
param2: int = 10,
) -> str:
"""Short description of what this tool does.
Args:
param1: Description of param1.
param2: Description of param2 (default: 10).
"""
# Implementation
result = await some_operation(param1, param2)
# Format as Markdown table
return format_as_markdown_table(result)
Security
- Never expose credentials in tool output
- Never write to the database
- Validate all inputs before processing