Servidor MCP para la API de contabilidad de Alegra. Permite realizar operaciones CRUD en una amplia gama de recursos como Facturas, Contactos, Items, Notas de Crédito, Órdenes de Compra y muchos más.
Single monolithic tool 'AlegraAPI' that violates core composition pattern by bundling 34 distinct resources and 5 HTTP methods into one tool. Tool description is adequate (154 chars) but lacks guidance on when/why to use specific endpoints. Input schema is well-structured with Zod validation and proper enum constraints on endpoint and method, but parameters like 'queryParams' are dangerously generic. No output schema documented. Error handling returns raw error messages without recovery guidance. The tool name 'AlegraAPI' is generic and does not start with an action verb, it should be decomposed into verb_noun patterns like 'list_invoices', 'create_contact', 'get_invoice_by_id'. The design forces LLMs to construct API payloads manually, increasing hallucination risk.
Una herramienta para interactuar con la API de contabilidad de Alegra. Permite realizar operaciones CRUD en una amplia gama de recursos como Facturas, Contactos, Items, Notas de Crédito, Órdenes de Compra y muchos más.
Tool name 'AlegraAPI' does not start with action verb and does not convey what happens when called. Should be decomposed into verb_noun patterns like 'list_invoices', 'create_contact', 'delete_invoice', 'update_contact'. Current naming prevents LLM from inferring intent from the name alone and creates unnecessary ambiguity.
Single tool bundles 34 distinct resources (invoices, contacts, items, credit-notes, etc.) and 5 HTTP methods into one monolithic handler. Violates single-responsibility principle. LLM cannot optimize for domain-specific parameters, validation, or error recovery per resource type. Should be split into separate tools: create_invoice, list_invoices, update_contact, delete_contact, etc.
Parameter 'queryParams' is a generic record<string, any> that accepts arbitrary key-value pairs. This invites hallucinated parameter names and malformed API payloads. For each endpoint, should define explicit parameters (e.g., 'limit', 'start', 'query' for GET; 'name', 'email', 'phone' for POST contact). Lack of schema prevents validation and increases errors.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 48 | <=2025-11-25 | v2 |
No output schema documented. Tool returns raw JSON.stringify() of API response without specifying which fields are present, what type each field is, or what the LLM should expect. LLM cannot reliably parse response structure or plan downstream calls. Should document schema per resource: e.g., 'list_invoices returns {invoices: [{id, number, date, total, status}], totalRecords}'.
Error handling returns raw error messages without actionable recovery guidance. E.g., 'Error de la API de Alegra: 404 Not Found - {...}' tells LLM nothing about what to do next (retry? search? ask user?). Should categorize errors (retryable, user-fixable, fatal) and include recovery hints like 'Contact not found. Try search_contacts() with a partial name.'
Tool description (154 chars) is generic and does not explain WHEN to use specific endpoints or what prerequisites exist. Lacks dependency hints. Should include: 'To create an invoice, first get a contact_id via list_contacts() or create_contact().' Current description is too brief to guide LLM selection.
No pagination guidance. Tool returns full JSON response without cap on result size. If list_invoices returns 1000+ records, response bloats context window and LLM reasoning degrades. Should enforce result limit (e.g., 'limit defaults to 20, max 100') and document in tool description.
'method' parameter defaults to 'get' but description does not explain how to construct POST/PUT/PATCH bodies via 'queryParams'. LLMs will struggle to format request payloads correctly. Should provide endpoint-specific body schema or explicit parameter names.
Destructive operations (DELETE, PATCH) not gated by confirmation. LLM can call 'delete invoice' without user approval. Should implement confirm_before_execute pattern or require explicit confirmation parameter.