Collection of MCP server implementations covering various patterns including calculator, web search, multimodal, context management, and tool routing
This is a course repository containing 24 tool definitions spread across multiple independent server implementations (clase4 through clase18). Quality is highly inconsistent: basic arithmetic tools (add, subtract, multiply, divide) repeat across files with minimal descriptions; the SerpApi search tools have better parameter structure but lack output schema documentation; context mutation tools lack idempotence guidance; and no tools include error handling guidance or output schemas. 5 tools (add variants) are duplicated verbatim across files, indicating this is a teaching repository rather than a unified server. Naming is mostly verb-noun compliant, but descriptions range from trivial ('Add two numbers') to missing entirely. No tools include permission gates, audit trails, or secret injection patterns despite tools like execute_tool and update_context being destructive or stateful.
Add two numbers
Sumar dos números.
Add two numbers
Add two numbers
Add two numbers
Add two numbers.
Suma dos números y devuelve el resultado.
Sumar dos números enteros.
Devuelve la raíz cuadrada de un número.
Duplicated tool definitions across files. The 'add' tool appears 6 times (instances 1-4, 10, 14 in clase5/client.py alone, plus variants). This indicates course-material organization rather than a cohesive server. Tool naming should be unique per server to avoid LLM confusion.
Trivial descriptions ('Add two numbers', 'Resta dos números') do not explain WHEN to use the tool, what the expected behavior is, or how to handle errors. Descriptions must be 10 - 1024 characters and answer: What does it do? When to use it? What does it return?
No output schemas documented for any tool. LLMs cannot plan downstream calls or extract fields without knowing what the response looks like. E.g., add returns an int, but callers don't see this; divide() mentions ValueError but error structure is not specified; SerpApi search tools return rich JSON but no schema is documented.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 44 | <=2025-11-25 | v2 |
| 2026-03-09 | F | 44 | - | v1 |
Divide dos números y devuelve el resultado. Error: ValueError: Si b es cero, se lanza un error de división por cero.
Divide dos números y devuelve el resultado. Error: ValueError: Si b es cero, se lanza un error de división por cero.
Ejecuta una herramienta específica con los parámetros dados.
Realiza una búsqueda general en la web utilizando SerpApi.
Te regresa el root context almacenado
Regresa el status del servidor.
Obtiene información del usuario por ID.
Multiplica dos números y devuelve el resultado.
Multiplica dos números y devuelve el resultado.
Realiza una búsqueda de noticias utilizando SerpApi.
Realiza una búsqueda de productos utilizando SerpApi.
Realiza una búsqueda de preguntas y respuestas utilizando SerpApi.
Resta dos números y devuelve el resultado.
Resta dos números y devuelve el resultado.
Actualiza el rootcontext dinamicamente
update_context (clase16) mutates global state (root_context dict) with no idempotence guarantee, permission gates, or audit trail. Repeated calls with same user_id and message overwrite without warning. Agents retry on ambiguous failures, non-idempotent tools risk undetectable side effects.
execute_tool (clase17) accepts arbitrary tool_name and parameters dict, routing to external endpoints. No input validation, sanitization, or rate limiting documented. Agents could be tricked via prompt injection into calling malicious endpoints or triggering DoS. Requires tool-gateway and rate-limit patterns.
divide (clase8) documents ValueError in the description ('Si b es cero...') but provides no error recovery guidance. LLMs don't know whether to retry, prompt the user, or abort. Error handling must tell the agent WHAT to do next.
SerpApi tools (general_search, news_search, product_search, qna) require SERPAPI_KEY environment variable, but no tool param describes what fields are returned or how to handle timeout/rate-limit errors. clase18/server.py has syntax error ('Dic' instead of 'Dict', missing comma in logging.basicConfig) and incomplete code sample.
Parameter naming inconsistency: execute_tool uses 'tool_name' and 'parameters', but other tools use plain 'a', 'b'. When a parameter could be an ID, name, email, or dict, suffix it with the type (user_id, user_name, parameters_dict) rather than overloading a single 'param' or bare 'parameters'.
No tools declare required permissions (e.g., 'read:email', 'write:database'). This violates the scope-declaration pattern and makes least-privilege agent configuration impossible. Each tool should declare its permission scope.
Tools like get_user_info (clase17) return hardcoded data without explaining that this is mock data. In production, users expect real API integration. Either document 'This is a demonstration tool with mock data' or integrate actual user lookup.