Skip to main content
Glama
backsoul

Dynamic Form MCP

by backsoul

create-form

Generate dynamic web forms with customizable fields like text inputs, dropdowns, and specialized elements for data collection and user interaction.

Instructions

Crea un formulario dinámico con campos personalizados

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTítulo del formulario
fieldsYesLista de campos del formulario

Implementation Reference

  • The handler function for the 'create-form' tool. It creates a new DynamicForm instance, adds a title field and the provided fields, generates the form URL asynchronously, logs the URL, and returns a text content block with either the success URL or an error message.
      const form = new DynamicForm(uuidv4());
      form.addField({ type: 'text-title', name: title });
    
      for (const field of fields) {
        form.addField(field);
      }
    
      const { url, error } = await form.createFormulary();
      console.log('create-form - url: ', url);
    
      if (error != null) {
        return { content: [{ type: 'text', text: `Ha ocurrido un error: ${error}` }] };
      }
    
      return { content: [{ type: 'text', text: `Formulario creado exitosamente: ${url}` }] };
    }
  • Zod schema for the input parameters of the 'create-form' tool: 'title' (required string min length 3) and 'fields' (array of at least one field object with properties like type, name, label, etc.).
    {
      title: z.string().min(3).describe('Título del formulario'),
      fields: z
        .array(
          z.object({
            type: z.string().describe('Tipo de campo (e.g., text-field, list-field)'),
            name: z.string().describe('Nombre del campo'),
            label: z.string().optional().describe('Etiqueta para mostrar en el formulario'),
            placeholder: z.string().optional().describe('Texto de marcador de posición'),
            required: z.boolean().optional().describe('Indica si el campo es obligatorio'),
            options: z.array(z.string()).optional().describe('Opciones para campos de lista'),
            url: z.string().optional().describe('URL para campos como qr-field o yt-video'),
            email: z.string().optional().describe('Correo electrónico para email-field'),
            subject: z.string().optional().describe('Asunto para email-field'),
            minLength: z.number().optional().describe('Longitud mínima para campos de texto'),
            maxLength: z.number().optional().describe('Longitud máxima para campos de texto'),
            pattern: z.string().optional().describe('Patrón de validación para campos de texto'),
            defaultValue: z.string().optional().describe('Valor por defecto del campo'),
          })
        )
        .min(1)
        .describe('Lista de campos del formulario'),
    },
    async ({ title, fields }) => {
  • src/index.ts:17-60 (registration)
    The registration of the 'create-form' tool on the MCP server using server.tool(), including name, description, input schema, and handler function.
    server.tool(
      'create-form',
      'Crea un formulario dinámico con campos personalizados',
      {
        title: z.string().min(3).describe('Título del formulario'),
        fields: z
          .array(
            z.object({
              type: z.string().describe('Tipo de campo (e.g., text-field, list-field)'),
              name: z.string().describe('Nombre del campo'),
              label: z.string().optional().describe('Etiqueta para mostrar en el formulario'),
              placeholder: z.string().optional().describe('Texto de marcador de posición'),
              required: z.boolean().optional().describe('Indica si el campo es obligatorio'),
              options: z.array(z.string()).optional().describe('Opciones para campos de lista'),
              url: z.string().optional().describe('URL para campos como qr-field o yt-video'),
              email: z.string().optional().describe('Correo electrónico para email-field'),
              subject: z.string().optional().describe('Asunto para email-field'),
              minLength: z.number().optional().describe('Longitud mínima para campos de texto'),
              maxLength: z.number().optional().describe('Longitud máxima para campos de texto'),
              pattern: z.string().optional().describe('Patrón de validación para campos de texto'),
              defaultValue: z.string().optional().describe('Valor por defecto del campo'),
            })
          )
          .min(1)
          .describe('Lista de campos del formulario'),
      },
      async ({ title, fields }) => {
        const form = new DynamicForm(uuidv4());
        form.addField({ type: 'text-title', name: title });
    
        for (const field of fields) {
          form.addField(field);
        }
    
        const { url, error } = await form.createFormulary();
        console.log('create-form - url: ', url);
    
        if (error != null) {
          return { content: [{ type: 'text', text: `Ha ocurrido un error: ${error}` }] };
        }
    
        return { content: [{ type: 'text', text: `Formulario creado exitosamente: ${url}` }] };
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Crea' implies a write/mutation operation, the description doesn't disclose important behavioral traits: what permissions are needed, whether the form becomes immediately available, what happens on failure, if there are rate limits, or what the return value looks like. For a creation tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Spanish that clearly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded with the essential information about what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation, what permissions are required, error conditions, or the structure of the response. The description alone doesn't provide enough context for an agent to understand the full implications of using this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('title' and 'fields') comprehensively with detailed field specifications. The description adds no parameter-specific information beyond what's in the schema. The baseline score of 3 is appropriate when the schema does the heavy lifting, even though the description doesn't add value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Crea' - creates) and resource ('un formulario dinámico con campos personalizados' - a dynamic form with custom fields). It specifies the type of form being created (dynamic with custom fields), which is reasonably specific. However, it doesn't explicitly differentiate from sibling tools like 'get-form' or 'create-answers'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There are sibling tools like 'get-form' (likely for retrieving forms) and 'create-answers' (likely for submitting form responses), but the description doesn't mention these alternatives or provide context about when this creation tool is appropriate versus other operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/backsoul/dynamicform-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server