Skip to main content
Glama
Yonsn76

MyPos MCP

by Yonsn76

renombrarTabla

Change the name of an existing database table in MySQL or PostgreSQL. Requires specifying the current table name and the new name, with caution advised as it can affect dependent queries or views.

Instructions

Sigue estas reglas OBLIGATORIAS para renombrar una tabla: ADVERTENCIA: Renombrar una tabla es una acción delicada que puede romper consultas o vistas existentes que dependan de ella. Procede con cuidado. PROPÓSITO: Cambiar el nombre de una tabla existente por uno nuevo. VERIFICACIÓN: Asegúrate de que el nuevo nombre no esté ya en uso. USO: Proporciona el nombre actual y el nuevo nombre. EJEMPLO: "Renombra la tabla ventas a ventas_2024."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nombreActualYesNombre actual de la tabla
nuevoNombreYesNuevo nombre para la tabla

Implementation Reference

  • Handler function that executes the table renaming logic using ALTER TABLE RENAME TO, supporting both MySQL and other DB types via quoteIdent.
    async ({ nombreActual, nuevoNombre }) => {
      try {
        if (!nombreActual || !nuevoNombre) {
          return { isError: true, content: [{ type: 'text', text: 'Debes proporcionar el nombre actual y el nuevo nombre.' }] };
        }
        let sql;
        if (db_type === 'mysql') {
          sql = `ALTER TABLE ${quoteIdent(nombreActual)} RENAME TO ${quoteIdent(nuevoNombre)}`;
        } else {
          sql = `ALTER TABLE ${quoteIdent(nombreActual)} RENAME TO ${quoteIdent(nuevoNombre)}`;
        }
        await query_runner.runQuery(sql);
        return { content: [{ type: 'text', text: `Tabla renombrada de '${nombreActual}' a '${nuevoNombre}' exitosamente.` }] };
      } catch (e) {
        return { isError: true, content: [{ type: 'text', text: 'Error al renombrar la tabla: ' + (e.message || e) }] };
      }
    }
  • Zod input schema defining parameters: nombreActual (current table name) and nuevoNombre (new table name).
    {
      nombreActual: z.string().describe('Nombre actual de la tabla'),
      nuevoNombre: z.string().describe('Nuevo nombre para la tabla'),
    },
  • mcp_server.js:438-467 (registration)
    Registration of the 'renombrarTabla' tool using server.tool(), including description, schema, and handler function.
    server.tool(
      'renombrarTabla',
      'Sigue estas reglas OBLIGATORIAS para renombrar una tabla:\n'
      + 'ADVERTENCIA: Renombrar una tabla es una acción delicada que puede romper consultas o vistas existentes que dependan de ella. Procede con cuidado.\n'
      + 'PROPÓSITO: Cambiar el nombre de una tabla existente por uno nuevo.\n'
      + 'VERIFICACIÓN: Asegúrate de que el nuevo nombre no esté ya en uso.\n'
      + 'USO: Proporciona el nombre actual y el nuevo nombre.\n'
      + 'EJEMPLO: "Renombra la tabla ventas a ventas_2024."',
      {
        nombreActual: z.string().describe('Nombre actual de la tabla'),
        nuevoNombre: z.string().describe('Nuevo nombre para la tabla'),
      },
      async ({ nombreActual, nuevoNombre }) => {
        try {
          if (!nombreActual || !nuevoNombre) {
            return { isError: true, content: [{ type: 'text', text: 'Debes proporcionar el nombre actual y el nuevo nombre.' }] };
          }
          let sql;
          if (db_type === 'mysql') {
            sql = `ALTER TABLE ${quoteIdent(nombreActual)} RENAME TO ${quoteIdent(nuevoNombre)}`;
          } else {
            sql = `ALTER TABLE ${quoteIdent(nombreActual)} RENAME TO ${quoteIdent(nuevoNombre)}`;
          }
          await query_runner.runQuery(sql);
          return { content: [{ type: 'text', text: `Tabla renombrada de '${nombreActual}' a '${nuevoNombre}' exitosamente.` }] };
        } catch (e) {
          return { isError: true, content: [{ type: 'text', text: 'Error al renombrar la tabla: ' + (e.message || e) }] };
        }
      }
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden. It does an excellent job disclosing critical behavioral traits: it warns that renaming is a 'delicate action that can break existing queries or views' and emphasizes proceeding with care. This goes beyond the basic rename function to highlight potential side effects and risks, which is valuable context for safe tool invocation.

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 well-structured with clear sections (ADVERTENCIA, PROPÓSITO, VERIFICACIÓN, USO, EJEMPLO) and every sentence earns its place. It's appropriately sized—concise yet comprehensive—with no wasted words, making it easy to scan and understand quickly.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does an excellent job covering the essential context: purpose, risks, verification steps, and usage instructions. The only minor gap is the lack of information about return values or confirmation of success, but given the warning-heavy nature of the tool, the description is largely complete for safe invocation.

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%, with both parameters clearly documented in the schema. The description adds minimal value beyond the schema: it mentions providing 'el nombre actual y el nuevo nombre' and includes an example, but doesn't explain parameter semantics beyond what the schema already states. This meets the baseline of 3 when schema coverage is high.

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 'Cambiar el nombre de una tabla existente por uno nuevo' (Change the name of an existing table to a new one), which is a specific verb+resource combination. It clearly distinguishes from sibling tools like 'renombrarColumna' (rename column) by focusing on tables rather than columns, and from 'eliminarTabla' (delete table) by being a rename operation rather than deletion.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: when you need to rename a table. It includes a verification step ('Asegúrate de que el nuevo nombre no esté ya en uso') and an example. However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the sibling tools, though the purpose clearly differentiates it from other table 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/Yonsn76/MyPos-MCP'

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