Skip to main content
Glama

list-tables

list-tables

Retrieve all user tables from a Firebird database to understand its structure and available data sources for analysis.

Instructions

Lists all user tables in the current Firebird database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'list-tables' MCP tool including the handler function that calls listTables() and formats the response.
    tools.set("list-tables", {
        name: "list-tables",
        description: "Lists all user tables in the current Firebird database.",
        inputSchema: ListTablesArgsSchema,
        handler: async () => {
            logger.info("Listing tables in the database");
    
            try {
                const tables = await listTables();
                logger.info(`Found ${tables.length} tables`);
    
                return {
                    content: [{
                        type: "text",
                        text: formatForClaude({ tables })
                    }]
                };
            } catch (error) {
                const errorResponse = wrapError(error);
                logger.error(`Error listando tablas: ${errorResponse.error} [${errorResponse.errorType || 'UNKNOWN'}]`);
    
                return {
                    content: [{
                        type: "text",
                        text: formatForClaude(errorResponse)
                    }]
                };
            }
        }
    });
  • Zod input schema for the list-tables tool (empty object as no parameters are required).
    export const ListTablesArgsSchema = z.object({}); // No arguments
  • Helper function listTables that performs the actual SQL query to list all user tables from the Firebird system table RDB$RELATIONS.
    export const listTables = async (config = DEFAULT_CONFIG): Promise<string[]> => {
        // Try to load config from global variable first
        const globalConfig = getGlobalConfig();
        if (globalConfig && globalConfig.database) {
            logger.info(`Using global configuration for listTables: ${globalConfig.database}`);
            config = globalConfig;
        }
        try {
            logger.info('Obteniendo lista de tablas de usuario');
    
            const sql = `
                SELECT RDB$RELATION_NAME
                FROM RDB$RELATIONS
                WHERE RDB$SYSTEM_FLAG = 0
                AND RDB$VIEW_SOURCE IS NULL
                ORDER BY RDB$RELATION_NAME
            `;
    
            const tables = await executeQuery(sql, [], config);
    
            // Firebird puede devolver nombres con espacios al final, así que hacemos trim
            const tableNames = tables.map((table: any) => table.RDB$RELATION_NAME.trim());
    
            logger.info(`Se encontraron ${tableNames.length} tablas de usuario`);
            return tableNames;
        } catch (error: any) {
            // Propagar el error si ya es un FirebirdError
            if (error instanceof FirebirdError) {
                throw error;
            }
    
            const errorMessage = `Error al listar tablas: ${error.message || error}`;
            logger.error(errorMessage);
            throw new FirebirdError(errorMessage, 'TABLE_LIST_ERROR', error);
        }
    };
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 action but does not describe the return format (e.g., list structure, pagination), permissions needed, or any side effects. 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.

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It is front-loaded with the core purpose and appropriately sized for the tool's simplicity.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It does not explain the return values, format, or any behavioral traits, leaving gaps for an AI agent to understand how to use the tool effectively.

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%, so the schema already documents this fully. The description appropriately does not add parameter details, maintaining a baseline score of 4 for no parameters.

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 clearly states the specific action ('Lists') and resource ('all user tables in the current Firebird database'), distinguishing it from siblings like describe-table or get-table-data. It precisely communicates the tool's function without ambiguity.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like describe-batch-tables or get-table-data. It lacks context about prerequisites, such as whether a database connection is required, or exclusions, such as not listing system tables.

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/PuroDelphi/mcpFirebird'

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