create-answers
Add multiple responses to one or more dynamic forms using UUIDs and field indexes with the 'create-answers' tool in the Dynamic Form MCP server.
Instructions
Agrega múltiples respuestas a uno o varios formularios mediante sus UUID y los índices de campo
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| answers | Yes | Array de respuestas a crear |
Implementation Reference
- src/index.ts:112-119 (handler)Handler function that creates answers for one or multiple forms by calling DynamicForm.createAnswers with the provided answers data.async ({ answers }) => { const form = new DynamicForm(); const { responses, error } = await form.createAnswers(answers); if (error) { return { content: [{ type: "text", text: `Error al crear las respuestas: ${error}` }] }; } return { content: [{ type: "text", text: JSON.stringify(responses, null, 2) }] }; }
- src/index.ts:93-111 (schema)Zod input schema defining an array of answers, each with a form UUID and field responses (index-value pairs).{ answers: z .array( z.object({ uuid: z.string().uuid().describe("UUID del formulario"), fields: z .array( z.object({ index: z.number().describe("Índice del campo"), value: z.string().describe("Valor de la respuesta") }) ) .min(1) .describe("Lista de respuestas por campo") }) ) .min(1) .describe("Array de respuestas a crear"), },
- src/index.ts:90-120 (registration)Registration of the 'create-answers' tool on the MCP server, including name, description, input schema, and handler function.server.tool( "create-answers", "Agrega múltiples respuestas a uno o varios formularios mediante sus UUID y los índices de campo", { answers: z .array( z.object({ uuid: z.string().uuid().describe("UUID del formulario"), fields: z .array( z.object({ index: z.number().describe("Índice del campo"), value: z.string().describe("Valor de la respuesta") }) ) .min(1) .describe("Lista de respuestas por campo") }) ) .min(1) .describe("Array de respuestas a crear"), }, async ({ answers }) => { const form = new DynamicForm(); const { responses, error } = await form.createAnswers(answers); if (error) { return { content: [{ type: "text", text: `Error al crear las respuestas: ${error}` }] }; } return { content: [{ type: "text", text: JSON.stringify(responses, null, 2) }] }; } );