Skip to main content
Glama
t2hnd

Bakery Data MCP Server

by t2hnd

get_schema

Retrieve database schema details like table structures and column definitions to understand bakery POS data organization.

Instructions

Get the database schema information including table structures and column definitions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get_schema tool handler within the call_tool function. It retrieves database table schemas from sqlite_master, column information using PRAGMA table_info, and row counts for each table, then returns the structured schema information as JSON text content.
    elif name == "get_schema": # Get all table information cursor.execute(""" SELECT name, sql FROM sqlite_master WHERE type='table' ORDER BY name """) tables = cursor.fetchall() schema_info = { "tables": {} } for table in tables: table_name = table["name"] schema_info["tables"][table_name] = { "create_sql": table["sql"] } # Get column info cursor.execute(f"PRAGMA table_info({table_name})") columns = cursor.fetchall() schema_info["tables"][table_name]["columns"] = columns # Get row count cursor.execute(f"SELECT COUNT(*) as count FROM {table_name}") row_count = cursor.fetchone()["count"] schema_info["tables"][table_name]["row_count"] = row_count return [TextContent( type="text", text=json.dumps(schema_info, ensure_ascii=False, indent=2) )]
  • Registration of the get_schema tool in the list_tools function, defining its name, description, and empty input schema (no parameters required).
    Tool( name="get_schema", description="Get the database schema information including table structures and column definitions.", inputSchema={ "type": "object", "properties": {} } )
  • Input schema definition for the get_schema tool, specifying an empty object (no input parameters required).
    inputSchema={ "type": "object", "properties": {} }

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/t2hnd/bakery_data_mcp'

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