Skip to main content
Glama
Yonsn76

MyPos MCP

by Yonsn76

listarTablas

Retrieve a complete list of all tables available in your MySQL or PostgreSQL database to understand the database structure and available data.

Instructions

Sigue estas reglas para listar tablas: PROPÓSITO: Obtener una lista de todas las tablas en la base de datos. USO: Úsalo cuando necesites saber qué tablas existen. EJEMPLO: "Muestra las tablas disponibles."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler function for the 'listarTablas' tool. It fetches the database schema using query_runner.getSchema() and returns a formatted list of table names.
    async () => {
      const schema = await query_runner.getSchema();
      return {
        content: [
          { type: 'text', text: 'Tablas:\n' + schema.map(t => `- ${t.name}`).join('\n') }
        ]
      };
    }
  • mcp_server.js:64-79 (registration)
    Registration of the 'listarTablas' MCP tool using server.tool(), including description, empty input schema, and inline handler.
    server.tool(
      'listarTablas',
      'Sigue estas reglas para listar tablas:\n'
      + 'PROPÓSITO: Obtener una lista de todas las tablas en la base de datos.\n'
      + 'USO: Úsalo cuando necesites saber qué tablas existen.\n'
      + 'EJEMPLO: "Muestra las tablas disponibles."',
      {},
      async () => {
        const schema = await query_runner.getSchema();
        return {
          content: [
            { type: 'text', text: 'Tablas:\n' + schema.map(t => `- ${t.name}`).join('\n') }
          ]
        };
      }
    );
  • Empty input schema (no parameters) for the 'listarTablas' tool.
    {},
  • QueryRunner.getSchema() method: Retrieves list of tables and their columns using database-specific queries (SHOW TABLES for MySQL, information_schema for PostgreSQL). Called by the tool handler to get table names.
    async getSchema() {
      if (this.db_type === 'mysql') {
        const [tables] = await this.pool.execute("SHOW TABLES");
        const tableKey = Object.keys(tables[0])[0];
        return await Promise.all(tables.map(async tbl => {
          const tableName = tbl[tableKey];
          const [cols] = await this.pool.execute(`SHOW COLUMNS FROM \`${tableName}\``);
          return {
            name: tableName,
            columns: cols.map(c => ({ name: c.Field, type: c.Type }))
          };
        }));
      } else { // pg
        const res = await this.pool.query(`
          SELECT table_name
          FROM information_schema.tables
          WHERE table_schema = 'public' AND table_type='BASE TABLE'
        `);
        return await Promise.all(res.rows.map(async row => {
          const tname = row.table_name;
          const res2 = await this.pool.query(`
            SELECT column_name, data_type
            FROM information_schema.columns
            WHERE table_name = $1
          `, [tname]);
          return {
            name: tname,
            columns: res2.rows.map(c => ({ name: c.column_name, type: c.data_type }))
          };
        }));
      }
    }
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. It states the tool lists all tables but doesn't mention behavioral traits like whether it's read-only, if it requires specific permissions, how results are formatted (e.g., pagination, sorting), or any rate limits. For a tool with zero annotation coverage, this is a significant gap, as it leaves the agent guessing about operational details.

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

Conciseness3/5

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

The description is structured with sections (PROPÓSITO, USO, EJEMPLO), which helps organization, but it's somewhat verbose for a simple tool. Sentences like 'Sigue estas reglas para listar tablas:' add unnecessary framing. The example 'Muestra las tablas disponibles.' is redundant with the purpose statement. It could be more concise by removing the introductory phrase and merging sections.

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 tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has gaps. It explains what the tool does and when to use it, but lacks behavioral context (e.g., output format, error handling). Without annotations or an output schema, the agent might not know what to expect from the results, making it incomplete for reliable use.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, and it correctly doesn't mention any. A baseline score of 4 is appropriate for tools with no parameters, as there's nothing to compensate for.

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 purpose: 'Obtener una lista de todas las tablas en la base de datos' (Get a list of all tables in the database). It specifies the verb ('obtener una lista') and resource ('tablas en la base de datos'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'consultarSQL' or 'columnasDeTabla', which might also involve table listing in different contexts.

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 usage guidance: 'Úsalo cuando necesites saber qué tablas existen' (Use it when you need to know what tables exist). This gives a specific context for when to use the tool. However, it doesn't mention when not to use it or provide explicit alternatives among siblings, such as distinguishing from 'consultarSQL' for more complex queries.

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