Skip to main content
Glama
Yonsn76

MyPos MCP

by Yonsn76

agregarColumna

Adds a new column to an existing database table by specifying the table name, column name, and data type definition for MySQL or PostgreSQL databases.

Instructions

Sigue estas reglas para agregar una columna: PROPÓSITO: Agregar una nueva columna a una tabla EXISTENTE. REGLA: No la uses para crear tablas nuevas ni para modificar o eliminar columnas existentes. PRECAUCIÓN: Asegúrate de que el nombre de la tabla y la nueva columna sean correctos antes de ejecutar. EJEMPLO: "Agrega la columna email a la tabla usuarios."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnaYesNombre de la nueva columna
tablaYesNombre de la tabla a modificar
tipoYesDefinición del tipo de la columna (ej. VARCHAR(255) NOT NULL)

Implementation Reference

  • The asynchronous handler function that validates input, constructs an ALTER TABLE ADD COLUMN SQL query using the quoteIdent helper, executes it via query_runner, and returns success or error messages.
    async ({ tabla, columna, tipo }) => {
      try {
        if (!/^[a-zA-Z0-9_]+$/.test(tabla) || !/^[a-zA-Z0-9_]+$/.test(columna)) {
          return {
            isError: true,
            content: [{ type: 'text', text: 'Nombre de tabla o columna no válido. Use solo letras, números y guiones bajos.' }]
          };
        }
        const query = `ALTER TABLE ${quoteIdent(tabla)} ADD COLUMN ${quoteIdent(columna)} ${tipo}`;
        await query_runner.runQuery(query);
        return { content: [{ type: 'text', text: `Columna '${columna}' agregada a la tabla '${tabla}' exitosamente.` }] };
      } catch (e) {
        return {
          isError: true,
          content: [{ type: 'text', text: 'Error al agregar la columna: ' + (e.message || e) }]
        };
      }
    }
  • Zod schema defining the input parameters for the tool: tabla (table name), columna (column name), and tipo (column type definition).
    {
      tabla: z.string().describe('Nombre de la tabla a modificar'),
      columna: z.string().describe('Nombre de la nueva columna'),
      tipo: z.string().describe('Definición del tipo de la columna (ej. VARCHAR(255) NOT NULL)'),
    },
  • mcp_server.js:280-310 (registration)
    The complete server.tool registration for 'agregarColumna', including name, description, schema, and handler function.
    server.tool(
      'agregarColumna',
      'Sigue estas reglas para agregar una columna:\n'
      + 'PROPÓSITO: Agregar una nueva columna a una tabla EXISTENTE.\n'
      + 'REGLA: No la uses para crear tablas nuevas ni para modificar o eliminar columnas existentes.\n'
      + 'PRECAUCIÓN: Asegúrate de que el nombre de la tabla y la nueva columna sean correctos antes de ejecutar.\n'
      + 'EJEMPLO: "Agrega la columna email a la tabla usuarios."',
      {
        tabla: z.string().describe('Nombre de la tabla a modificar'),
        columna: z.string().describe('Nombre de la nueva columna'),
        tipo: z.string().describe('Definición del tipo de la columna (ej. VARCHAR(255) NOT NULL)'),
      },
      async ({ tabla, columna, tipo }) => {
        try {
          if (!/^[a-zA-Z0-9_]+$/.test(tabla) || !/^[a-zA-Z0-9_]+$/.test(columna)) {
            return {
              isError: true,
              content: [{ type: 'text', text: 'Nombre de tabla o columna no válido. Use solo letras, números y guiones bajos.' }]
            };
          }
          const query = `ALTER TABLE ${quoteIdent(tabla)} ADD COLUMN ${quoteIdent(columna)} ${tipo}`;
          await query_runner.runQuery(query);
          return { content: [{ type: 'text', text: `Columna '${columna}' agregada a la tabla '${tabla}' exitosamente.` }] };
        } catch (e) {
          return {
            isError: true,
            content: [{ type: 'text', text: 'Error al agregar la columna: ' + (e.message || e) }]
          };
        }
      }
    );
Behavior3/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. It adds useful context such as the caution to ensure table and column names are correct before execution, which hints at potential errors or destructive effects. However, it lacks details on permissions, rate limits, or what happens on success/failure, leaving gaps in behavioral transparency.

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

Conciseness4/5

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

The description is structured with clear sections (PROPÓSITO, REGLA, PRECAUCIÓN, EJEMPLO), making it easy to scan. It is appropriately sized with four concise sentences that each add value, though the example could be integrated more smoothly. There is minimal waste, but slight room for improvement in flow.

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

Completeness3/5

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

Given the complexity of a database mutation tool with no annotations and no output schema, the description is moderately complete. It covers purpose, usage rules, and cautions, but lacks details on behavioral aspects like error handling or return values. It compensates somewhat with the example, but more context on outcomes would enhance completeness.

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 all three parameters (columna, tabla, tipo) with clear descriptions. The description does not add any additional semantic meaning beyond what the schema provides, such as examples of 'tipo' values or constraints. Baseline 3 is appropriate when the schema handles parameter documentation adequately.

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

Purpose5/5

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

The description explicitly states the purpose as 'Agregar una nueva columna a una tabla EXISTENTE' (Add a new column to an EXISTING table), which is a specific verb+resource combination. It clearly distinguishes this tool from sibling tools like 'crearTabla' (create table), 'eliminarColumna' (delete column), and 'renombrarColumna' (rename column), making the distinction explicit.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use and when not to use this tool: 'No la uses para crear tablas nuevas ni para modificar o eliminar columnas existentes' (Do not use it to create new tables or to modify or delete existing columns). It also implies alternatives by naming sibling tools like 'crearTabla' for table creation, offering clear context for tool selection.

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/Yonsn76/MyPos-MCP'

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