Skip to main content
Glama

get_schema

Retrieves all CREATE TABLE and CREATE VIEW statements from the WhatsApp database so you can write correct SQL queries against chats, messages, and search views.

Instructions

Return the database schema: every CREATE TABLE / CREATE VIEW / CREATE VIRTUAL TABLE statement. Call this once before writing SQL — the views (v_messages, v_chats, messages_fts, ...) are the intended query surface.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
schemaYesthe full DDL: CREATE TABLE / VIEW / VIRTUAL TABLE statements, semicolon-separated

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.24

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does reasonably well: "Return" establishes it is a non-mutating read, "Call this once" discloses idempotence and warns against redundant calls, and the payload is described concretely as DDL text. It does not discuss result size, whether the schema is live versus cached, or what happens if the database is empty, which are the remaining behavioral unknowns.

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?

Two sentences, front-loaded with what the tool returns before the instruction on when to call it. Every clause earns its place: the DDL enumeration sets expectations for the payload and the view names give the agent actionable targets.

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

Completeness5/5

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

For a zero-parameter introspection tool with an output schema already defined, the description covers what is returned, when to invoke it, and how the results should be used. Nothing an agent needs in order to call it correctly is missing.

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 takes zero parameters and the schema is a bare object, so there is no parameter meaning to convey and no risk of ambiguity. The description correctly spends none of its words on arguments.

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?

States a specific verb and resource ("Return the database schema") and enumerates the exact payload — every CREATE TABLE / CREATE VIEW / CREATE VIRTUAL TABLE statement. Nothing overlaps with the query/search/send siblings, so an agent can immediately tell this is the introspection tool rather than a data-access one.

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?

It gives an explicit call pattern — "Call this once before writing SQL" — which tells the agent both when to use it and that it should not be called repeatedly. It also points to the intended downstream surface (the views), which steers subsequent querying. It stops short of an explicit when-not or a named alternative for fetching partial schema, so it is clear context rather than a full routing rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools