Skip to main content
Glama

get-field-descriptions

get-field-descriptions

Retrieve stored descriptions for table fields in Firebird databases to understand data structure and column purposes.

Instructions

Gets the stored descriptions for fields of a specific table (if they exist).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNameYesName of the table to get field descriptions for

Implementation Reference

  • Zod input schema for the get-field-descriptions tool, requiring a tableName string.
    export const GetFieldDescriptionsArgsSchema = z.object({
        tableName: z.string().min(1).describe("Name of the table to get field descriptions for")
    });
  • Registers the get-field-descriptions MCP tool in the tools map, including name, description, input schema, and handler function that delegates to getFieldDescriptions and formats the response.
    tools.set("get-field-descriptions", {
        name: "get-field-descriptions",
        description: "Gets the stored descriptions for fields of a specific table (if they exist).",
        inputSchema: GetFieldDescriptionsArgsSchema,
        handler: async (args: z.infer<typeof GetFieldDescriptionsArgsSchema>) => {
            const { tableName } = args;
            logger.info(`Getting field descriptions for table: ${tableName}`);
    
            try {
                const fieldDescriptions = await getFieldDescriptions(tableName);
                logger.info(`Descriptions obtained for ${fieldDescriptions.length} fields in table ${tableName}`);
    
                return {
                    content: [{
                        type: "text",
                        text: formatForClaude({ fieldDescriptions })
                    }]
                };
            } catch (error) {
                const errorResponse = wrapError(error);
                logger.error(`Error getting field descriptions for table ${tableName}: ${errorResponse.error} [${errorResponse.errorType || 'UNKNOWN'}]`);
    
                return {
                    content: [{
                        type: "text",
                        text: formatForClaude(errorResponse)
                    }]
                };
            }
        }
    });
  • Core handler function that executes a SQL query against Firebird system table RDB$RELATION_FIELDS to retrieve field names and their descriptions (RDB$DESCRIPTION) for the specified table, with validation, logging, and error handling.
    export const getFieldDescriptions = async (tableName: string, config = DEFAULT_CONFIG): Promise<FieldInfo[]> => {
        // Try to load config from global variable first
        const globalConfig = getGlobalConfig();
        if (globalConfig && globalConfig.database) {
            logger.info(`Using global configuration for getFieldDescriptions: ${globalConfig.database}`);
            config = globalConfig;
        }
        try {
            logger.info(`Obteniendo descripciones de campos para la tabla: ${tableName}`);
    
            if (!validateSql(tableName)) {
                throw new FirebirdError(
                    `Nombre de tabla inválido: ${tableName}`,
                    'VALIDATION_ERROR'
                );
            }
    
            const sql = `
                SELECT
                    TRIM(RF.RDB$FIELD_NAME) AS FIELD_NAME,
                    CAST(RF.RDB$DESCRIPTION AS VARCHAR(500)) AS DESCRIPTION
                FROM
                    RDB$RELATION_FIELDS RF
                WHERE
                    RF.RDB$RELATION_NAME = ?
                ORDER BY
                    RF.RDB$FIELD_POSITION
            `;
    
            const fields = await executeQuery(sql, [tableName], config);
    
            if (fields.length === 0) {
                logger.warn(`No se encontraron campos para la tabla: ${tableName}`);
            } else {
                logger.info(`Se encontraron ${fields.length} campos para la tabla: ${tableName}`);
            }
    
            return fields.map((field: any) => ({
                name: field.FIELD_NAME,
                description: field.DESCRIPTION || null
            }));
        } catch (error: any) {
            // Propagar el error si ya es un FirebirdError
            if (error instanceof FirebirdError) {
                throw error;
            }
    
            const errorMessage = `Error obteniendo descripciones de campos para ${tableName}: ${error.message || error}`;
            logger.error(errorMessage);
            throw new FirebirdError(errorMessage, 'FIELD_DESCRIPTION_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 mentions that descriptions are retrieved 'if they exist', which adds some context about optional data. However, it lacks details on permissions, rate limits, response format, or error handling, which are important for a read operation.

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 a single, efficient sentence that directly states the tool's purpose. It's front-loaded with the main action, though it could be slightly more structured if it included brief usage notes. There's no wasted wording.

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 low complexity (one parameter, read-only implied) and lack of annotations or output schema, the description is minimally adequate. It covers the basic purpose but misses behavioral details like return format or error cases, which would enhance completeness for agent use.

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?

The input schema has 100% description coverage, with 'tableName' clearly documented. The description adds minimal value by implying the tool fetches field descriptions, but it doesn't provide additional semantics beyond what the schema already states. 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Gets') and resource ('stored descriptions for fields of a specific table'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'describe-table' or 'describe-batch-tables', which might have overlapping functionality, so it doesn't reach the highest score.

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. It doesn't mention sibling tools like 'describe-table' or 'describe-batch-tables', nor does it specify prerequisites or exclusions, leaving usage context unclear.

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