Skip to main content
Glama

datamodel.get_data

datamodel_get_data
Read-only

Retrieve data from a data model table with an optional SQL query to filter rows. Returns a list of dicts that can be converted to a dataframe.

Instructions

Retrieve data from a specific table in a data model. Runs a SQL query against the data model and returns the rows in a row-based format (a list of dicts) compatible with to_dataframe. Returns: list[dict[str, Any]] | dict[str, Any] List of dictionaries where each dict represents a row — an empty list means the query genuinely returned no data. On failure, returns the standard ``{"ok": False, "error": "...", …

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoOptional SQL query to filter the data. When omitted, all rows of the table are selected.
table_nameYesName of the table to retrieve data from.
datamodel_nameYesName of the data model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already establish read-only and non-destructive behavior, and the description adds meaningful context: success returns a list of dicts, an empty list means genuinely no data, and failure returns a standard error dict. This goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded and mostly efficient, but the failure-return sentence is truncated mid-structure with '...', making it incomplete. It reads as slightly malformed rather than fully polished.

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

Completeness4/5

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

With no output schema, the description compensates by specifying the row format, empty-list semantics, and failure return behavior. It omits a full error-dict shape and SQL execution caveats, but for a simple read-only 3-param tool it is fairly complete.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents datamodel_name, table_name, and query. The description adds no parameter-specific meaning beyond restating that a SQL query is executed, so the baseline of 3 is appropriate.

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 action and resource: 'Retrieve data from a specific table in a data model' via a SQL query. It is distinct from schema/count siblings by emphasizing a row-based list-of-dicts result compatible with to_dataframe.

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 description conveys when to use the tool: when table row data is needed, optionally filtered by SQL. However, it never explicitly distinguishes it from alternatives like datamodel_get_row_count or datamodel_get_table_schema, so the routing is implied rather than stated.

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