Skip to main content
Glama

Search schema

search_schema
Read-onlyIdempotent

Find tables and columns by keyword when you know the data name but not its location. Returns matching columns and their tables for MySQL, PostgreSQL, or SQLite schemas.

Instructions

Find tables and columns whose name contains a keyword (case-insensitive substring; on MySQL also column comments). Use it when you know WHAT you are looking for but not WHERE it is stored; use tables instead to browse everything and describe for one known table. Returns matches[N]{table,column,type}, one row per matching column (a table-name match lists all its columns), capped at 500 rows (truncated: true when cut). On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesKeyword to look for, e.g. invoice, email, price.
databaseNoOptional database to use instead of the connection's default (names from `databases`). Omit to use the default.
connectionYesConnection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.2
    • changedInput schema / properties / connection / description
      Previous value: -"Connection name (from `connections`)"New value: +"Connection name exactly as returned by `connections` (e.g. \"shop\"). Unknown or unexposed names return an error."
    • changedInput schema / properties / database / description
      Previous value: -"Database name to use instead of the connection's default (optional)"New value: +"Optional database to use instead of the connection's default (names from `databases`). Omit to use the default."
    • changedInput schema / properties / text / description
      Previous value: -"Keyword, e.g. invoice"New value: +"Keyword to look for, e.g. invoice, email, price."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds substantial extra context: the return shape (matches[N]{table,column,type}), the row-per-column behavior including table-name matches listing all columns, the 500-row cap with a truncation flag, and the error contract ('error: <reason>'). This goes well beyond the annotation coverage.

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?

Dense and front-loaded: purpose and routing come first, then return shape, then the error contract. Every clause carries information, and nothing is redundant with the structured fields.

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?

Despite having no output schema, the description fully specifies the return format, truncation behavior, and failure mode. Combined with complete schema coverage and annotations, an agent has everything needed to call and interpret it correctly.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine semantics for `text` (case-insensitive substring match, and column comments on MySQL) that meaningfully augment the schema. It does not re-explain the `connection` or `database` parameters, which is acceptable given full schema coverage.

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 (find) and resource (tables and columns) with precise matching semantics. It clearly distinguishes itself from siblings by noting it is for finding something when you know the name but not the location, as opposed to browsing (`tables`) or inspecting a known table (`describe`).

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?

Explicitly states when to use it ('when you know WHAT you are looking for but not WHERE it is stored') and names the alternatives for the adjacent cases: `tables` for browsing everything and `describe` for one known table. Routing is fully inference-free.

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