get-answers
Retrieve form responses using a form's unique identifier. This tool fetches submitted answers from dynamic forms for analysis or processing.
Instructions
Obtiene las respuestas de un formulario existente mediante su UUID
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"uuid": "<uuid>"
},
"name": "get-answers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID del formulario |
Implementation Reference
- src/index.ts:76-88 (registration)Full registration of the 'get-answers' tool using server.tool(), including the tool name, description, input schema (UUID), and the complete handler function that fetches and returns form answers.
server.tool( "get-answers", "Obtiene las respuestas de un formulario existente mediante su UUID", { uuid: z.string().uuid().describe("UUID del formulario") }, async ({ uuid }) => { const form = new DynamicForm(uuid); const { answers, error } = await form.getAnswers(); if (error) { return { content: [{ type: "text", text: `Error al obtener las respuestas: ${error}` }] }; } return { content: [{ type: "text", text: JSON.stringify(answers) }] }; } ); - src/index.ts:80-87 (handler)The handler function implementing the core logic of the 'get-answers' tool: instantiates DynamicForm with UUID, calls getAnswers(), handles errors, and formats the response as MCP content.
async ({ uuid }) => { const form = new DynamicForm(uuid); const { answers, error } = await form.getAnswers(); if (error) { return { content: [{ type: "text", text: `Error al obtener las respuestas: ${error}` }] }; } return { content: [{ type: "text", text: JSON.stringify(answers) }] }; } - src/index.ts:79-79 (schema)Zod input schema for the 'get-answers' tool, validating a single 'uuid' parameter as a string UUID.
{ uuid: z.string().uuid().describe("UUID del formulario") },