Skip to main content
Glama
Yonsn76

MyPos MCP

by Yonsn76

eliminarRestriccionUnica

Remove a UNIQUE constraint from a database table to allow duplicate values, requiring explicit confirmation to proceed.

Instructions

Sigue estas reglas OBLIGATORIAS para eliminar una restricción UNIQUE: ADVERTENCIA INICIAL: Informa al usuario que eliminar esta restricción permitirá datos duplicados, lo que podría afectar la integridad de los datos. CONFIRMACIÓN EXPLÍCITA: Para proceder, el usuario DEBE escribir la frase exacta: "Confirmar eliminación de la restricción [nombreRestriccion] de la tabla [nombreTabla]". VERIFICACIÓN ESTRICTA: No ejecutes la eliminación si la confirmación no es exacta. USO: Especifica la tabla y el nombre exacto de la restricción a eliminar. EJEMPLO: "Elimina la restricción única email_unique de la tabla usuarios."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nombreYesNombre de la restricción UNIQUE
tablaYesNombre de la tabla

Implementation Reference

  • Handler function that executes the tool logic: drops a UNIQUE constraint/index from a table using ALTER TABLE depending on the database type (MySQL vs PostgreSQL).
    async ({ tabla, nombre }) => {
      try {
        if (!tabla || !nombre) {
          return { isError: true, content: [{ type: 'text', text: 'Debes proporcionar la tabla y el nombre de la restricción.' }] };
        }
        let sql;
        if (db_type === 'mysql') {
          sql = `ALTER TABLE ${quoteIdent(tabla)} DROP INDEX ${quoteIdent(nombre)}`;
        } else {
          sql = `ALTER TABLE ${quoteIdent(tabla)} DROP CONSTRAINT ${quoteIdent(nombre)}`;
        }
        await query_runner.runQuery(sql);
        return { content: [{ type: 'text', text: 'Restricción UNIQUE eliminada exitosamente.' }] };
      } catch (e) {
        return { isError: true, content: [{ type: 'text', text: 'Error al eliminar restricción UNIQUE: ' + (e.message || e) }] };
      }
    }
  • Input schema using Zod: requires 'tabla' (table name) and 'nombre' (constraint name).
    {
      tabla: z.string().describe('Nombre de la tabla'),
      nombre: z.string().describe('Nombre de la restricción UNIQUE'),
    },
  • mcp_server.js:590-619 (registration)
    MCP tool registration using server.tool, including description, input schema, and handler function.
    server.tool(
      'eliminarRestriccionUnica',
      'Sigue estas reglas OBLIGATORIAS para eliminar una restricción UNIQUE:\n'
      + 'ADVERTENCIA INICIAL: Informa al usuario que eliminar esta restricción permitirá datos duplicados, lo que podría afectar la integridad de los datos.\n'
      + 'CONFIRMACIÓN EXPLÍCITA: Para proceder, el usuario DEBE escribir la frase exacta: "Confirmar eliminación de la restricción [nombreRestriccion] de la tabla [nombreTabla]".\n'
      + 'VERIFICACIÓN ESTRICTA: No ejecutes la eliminación si la confirmación no es exacta.\n'
      + 'USO: Especifica la tabla y el nombre exacto de la restricción a eliminar.\n'
      + 'EJEMPLO: "Elimina la restricción única email_unique de la tabla usuarios."',
      {
        tabla: z.string().describe('Nombre de la tabla'),
        nombre: z.string().describe('Nombre de la restricción UNIQUE'),
      },
      async ({ tabla, nombre }) => {
        try {
          if (!tabla || !nombre) {
            return { isError: true, content: [{ type: 'text', text: 'Debes proporcionar la tabla y el nombre de la restricción.' }] };
          }
          let sql;
          if (db_type === 'mysql') {
            sql = `ALTER TABLE ${quoteIdent(tabla)} DROP INDEX ${quoteIdent(nombre)}`;
          } else {
            sql = `ALTER TABLE ${quoteIdent(tabla)} DROP CONSTRAINT ${quoteIdent(nombre)}`;
          }
          await query_runner.runQuery(sql);
          return { content: [{ type: 'text', text: 'Restricción UNIQUE eliminada exitosamente.' }] };
        } catch (e) {
          return { isError: true, content: [{ type: 'text', text: 'Error al eliminar restricción UNIQUE: ' + (e.message || e) }] };
        }
      }
    );
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly describes the tool's behavior: the mandatory warning to users, strict confirmation requirement, exact phrase verification, and the potential impact on data integrity (allowing duplicate data). This goes well beyond basic parameter documentation.

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 well-structured with clear sections (ADVERTENCIA, CONFIRMACIÓN, VERIFICACIÓN, USO, EJEMPLO) and uses bullet-point-like formatting. However, it could be more concise by integrating some points; the example partially repeats usage instructions. Every sentence adds value, but minor trimming is possible.

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

Completeness5/5

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

Given the tool's complexity (a destructive operation with safety mechanisms), no annotations, and no output schema, the description is highly complete. It covers purpose, usage rules, behavioral constraints, warnings, and provides an example. This adequately compensates for the lack of structured metadata.

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 ('nombre' and 'tabla'). The description adds minimal parameter semantics beyond the schema—it mentions specifying table and constraint name but doesn't provide additional context about format or constraints. This meets the baseline for high schema coverage.

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 tool's purpose: 'eliminar una restricción UNIQUE' (delete a UNIQUE constraint). It uses a specific verb ('eliminar') and resource ('restricción UNIQUE'), and clearly distinguishes it from sibling tools like 'eliminarClaveForanea' or 'eliminarColumna' by focusing on unique constraints specifically.

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 usage rules: it specifies when to use (to delete a unique constraint), includes a mandatory confirmation step ('Confirmar eliminación...'), and gives an example. It also warns about data integrity implications, which helps differentiate it from other deletion tools.

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