Skip to main content
Glama
Arun-kc

schemabrain

get_example_queries

Read-onlyIdempotent

Retrieve real example SQL queries for a specified table. Each result includes SQL text, observation count, source, and PII categories to reveal actual usage patterns.

Instructions

Use this when you need real example SQL for an indexed table to learn how it's actually used. Each item carries the SQL text, observation count, source, and PII categories touched. Returns status: empty when the table has no recorded examples yet (query log mining ships next). Use describe_table instead when you want the table's structural shape rather than usage patterns. Common composition: chain find_relevant_tables to get_example_queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qualified_nameYesPostgres `schema.table` qualified name (e.g. `public.orders`). Returns SQL agents (or humans) have actually run against this table, sourced from `pg_stat_statements`. Run `schemabrain mine-queries` first to populate the cache; until then this tool returns `status: empty`.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
dataNo
errorNo
confidenceNo
provenanceNo
follow_up_hintsNo
degradation_reasonNo
charter_versionNo1.2
Behavior5/5

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

Annotations already indicate read-only, non-destructive, idempotent behavior; the description adds context about returning status:empty when not populated, the data source (pg_stat_statements), and the prerequisite (run schemabrain mine-queries), going well beyond annotations.

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?

Every sentence adds value: purpose, return contents, empty status, alternative, and composition suggestion. No filler, well-front-loaded.

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?

Covers what is returned, when empty, prerequisite, alternative, and composition. With an output schema present, no further detail needed on return structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter, qualified_name, is thoroughly described in the schema with format, example, source, and prerequisite; no ambiguity remains.

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 tool provides real example SQL for an indexed table, distinguishing it from siblings like describe_table by explicitly contrasting usage patterns with structural shape.

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

Usage Guidelines5/5

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

It tells when to use (need real example SQL) and when not (table has no recorded examples), provides a direct alternative (describe_table), and suggests a common composition pattern (chain with find_relevant_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/Arun-kc/schemabrain'

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