Skip to main content
Glama
Yonsn76

MyPos MCP

by Yonsn76

exportarTabla

Export table data from MySQL or PostgreSQL databases to CSV or JSON format, with optional column selection for partial data extraction.

Instructions

Sigue estas reglas para exportar una tabla: PROPÓSITO: Exportar los datos de una tabla a un formato de texto (CSV o JSON). USO: Especifica la tabla y el formato deseado. Opcionalmente, puedes indicar columnas específicas para exportar solo una parte de los datos. EJEMPLO: "Exporta la tabla clientes a CSV."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnasNoColumnas a exportar (opcional)
formatoYesFormato de exportación
tablaYesNombre de la tabla a exportar

Implementation Reference

  • The handler function for the 'exportarTabla' tool. Constructs a SELECT SQL query for the given table and optional columns, executes it via query_runner.runQuery, and returns the results formatted as JSON or CSV depending on the 'formato' parameter.
    async ({ tabla, formato, columnas }) => {
      try {
        let sql = 'SELECT ';
        if (columnas && columnas.length > 0) {
          sql += columnas.map(quoteIdent).join(', ');
        } else {
          sql += '*';
        }
        sql += ` FROM ${quoteIdent(tabla)}`;
        const result = await query_runner.runQuery(sql);
        if (formato === 'json') {
          return { content: [{ type: 'text', text: JSON.stringify(result.rows, null, 2) }] };
        } else {
          // CSV
          const csv = json2csv(result.rows);
          return { content: [{ type: 'text', text: csv }] };
        }
      } catch (e) {
        return { isError: true, content: [{ type: 'text', text: 'Error al exportar tabla: ' + (e.message || e) }] };
      }
    }
  • Zod input schema defining parameters: 'tabla' (required string), 'formato' (enum csv/json), 'columnas' (optional array of strings).
    {
      tabla: z.string().describe('Nombre de la tabla a exportar'),
      formato: z.enum(['csv', 'json']).describe('Formato de exportación'),
      columnas: z.array(z.string()).optional().describe('Columnas a exportar (opcional)'),
    },
  • mcp_server.js:150-155 (registration)
    Registration of the 'exportarTabla' tool using server.tool(), including the tool name and usage description.
    server.tool(
      'exportarTabla',
      'Sigue estas reglas para exportar una tabla:\n'
      + 'PROPÓSITO: Exportar los datos de una tabla a un formato de texto (CSV o JSON).\n'
      + 'USO: Especifica la tabla y el formato deseado. Opcionalmente, puedes indicar columnas específicas para exportar solo una parte de los datos.\n'
      + 'EJEMPLO: "Exporta la tabla clientes a CSV."',
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. It describes the action (export) and optional column selection but lacks details on behavioral traits like whether this requires specific permissions, if it's a read-only operation, what happens to the exported data (e.g., file generation, download), or any rate limits. For a 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.

Conciseness4/5

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

The description is structured with clear sections (PROPÓSITO, USO, EJEMPLO) and uses three sentences efficiently. However, the example 'Exporta la tabla clientes a CSV.' is redundant with the purpose and usage sections, slightly reducing conciseness. Overall, it is front-loaded and appropriately sized.

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 no annotations, no output schema, and 100% schema coverage, the description is adequate but has clear gaps. It covers the purpose and basic usage but lacks behavioral context (e.g., permissions, output handling) and does not explain return values. For a tool with moderate complexity (exporting data), this is minimal viable but incomplete.

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 (tabla, formato, columnas) with descriptions and enum values. The description adds minimal value beyond the schema by mentioning the same parameters in the 'USO' section, but does not provide additional syntax or format details. Baseline 3 is appropriate when the schema does the heavy lifting.

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 'Exportar los datos de una tabla a un formato de texto (CSV o JSON)', which is a specific verb (exportar) + resource (datos de una tabla) + output format. It clearly distinguishes from siblings like importarTabla (import), consultarSQL (query), or listarTablas (list), which have different functions.

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 on when to use it: 'Especifica la tabla y el formato deseado. Opcionalmente, puedes indicar columnas específicas para exportar solo una parte de los datos.' It gives basic usage instructions but does not explicitly state when NOT to use it or name alternatives among siblings, such as consultarSQL for querying instead of exporting.

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