Skip to main content
Glama
MikelA92
by MikelA92

get_field

Retrieve detailed metadata about a specific database column including its data type, description, and field properties to understand column contents and structure.

Instructions

🔍 [SAFE] Get detailed information about a specific field/column including its type, description, and metadata. Use this to understand what a column contains. Risk: None - read-only operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldIdYesThe ID of the field

Implementation Reference

  • The handler function getField that implements the core logic of the 'get_field' tool. It validates the fieldId, fetches the field data from the Metabase API, formats it into a text response, and returns it in the MCP content format.
    async getField(fieldId) { Validators.validateFieldId(fieldId); this.logger.debug('Getting field', { fieldId }); const field = await this.apiClient.makeRequest(`/api/field/${fieldId}`); return { content: [ { type: 'text', text: `Field Information: ID: ${field.id} Name: ${field.name} Display Name: ${field.display_name} Type: ${field.base_type} Semantic Type: ${field.semantic_type || 'None'} Description: ${field.description || 'No description'} Table: ${field.table?.name}`, }, ], }; }
  • The schema definition for the 'get_field' tool, including name, description, and inputSchema specifying the required fieldId parameter.
    { name: 'get_field', description: '🔍 [SAFE] Get detailed information about a specific field/column including its type, description, and metadata. Use this to understand what a column contains. Risk: None - read-only operation.', inputSchema: { type: 'object', properties: { fieldId: { type: 'integer', description: 'The ID of the field', minimum: 1, }, }, required: ['fieldId'], }, },
  • The registration/dispatch point in the executeTool method where 'get_field' tool calls are routed to the fieldHandlers.getField method.
    case 'get_field': return await this.fieldHandlers.getField(args.fieldId);
  • The tool list handler that returns TOOL_DEFINITIONS, which includes the 'get_field' tool schema for MCP clients to discover available tools.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { this.logger.debug('Listing tools'); return { tools: TOOL_DEFINITIONS, }; });
  • Instantiation of the FieldHandlers class instance used by the 'get_field' tool.
    this.fieldHandlers = new FieldHandlers(this.apiClient);

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/MikelA92/metabase-mcp-mab'

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