Skip to main content
Glama
sql-mcp

sql-mcp

by hogiabao2601

describe_table

Read-only

Retrieve a table's columns, types, nullability, keys, defaults, indexes, and foreign keys in both directions to map relationships and write accurate JOINs.

Instructions

Describe one table: columns (type, nullability, key, default, comment), indexes, and foreign keys in BOTH directions (what it references, and what references it). Use the foreign keys to work out JOINs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "table": "<table>"
    },
    "name": "describe_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes
schemaNo
profileNo
databaseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered elsewhere. The description adds real value by promising bidirectional foreign-key reporting, which is a behavioral trait an agent couldn't assume. It does not say what happens for a nonexistent table or an ambiguous table across databases, which matters for a 4-param lookup tool.

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?

Three short sentences, front-loaded with the verb and resource, then the returned detail, then a practical instruction. Every clause adds information and there is no filler.

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?

There is no output schema, so the description does well to enumerate the return shape (columns, indexes, FKs both directions). However, with four parameters at 0% schema coverage and only 'table' implicitly explained, an agent is left guessing about schema/profile/database selection and multi-database resolution.

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

Parameters2/5

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

Schema description coverage is 0%, so all four parameters (table, schema, profile, database) are named-only in the schema. The description clarifies that exactly one table is described, giving some meaning to 'table', but schema, profile, and database are never mentioned anywhere. For a 0%-coverage schema the description should carry the load, and it does not.

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?

States a specific verb and resource ('Describe one table') and then enumerates exactly what the description covers: columns with type/nullability/key/default/comment, indexes, and foreign keys in both directions. This is far richer than a sibling like list_tables, and an agent can infer the distinction without opening a schema. It stops short of an explicit sibling comparison, so it lands at 4 rather than 5.

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

Usage Guidelines3/5

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

The final sentence, 'Use the foreign keys to work out JOINs', describes how to use the output rather than when to choose this tool over list_tables or search_schema. The context for invocation (inspecting a table before writing a query) is implied only. No when-not guidance or prerequisites are given.

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