Skip to main content
Glama

get_table_sql

Extract a table's partition SQL query with line numbers and surrounding context. Use it to audit or edit Value.NativeQuery definitions in Power BI semantic models.

Instructions

Extract the partition SQL query (with line numbers and M context) for a table.

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_table_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
partitionNoOptional partition name if the table has multiple SQL partitions.
workspaceNoWorkspace identifier returned by list_workspaces (prefer workspace_id or unique name). Optional when the server is bound to a single workspace.
table_nameNoTable name containing a Value.NativeQuery SQL partition.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose useful output behavior ('with line numbers and M context'), which tells the agent the result is annotated source rather than a raw query string. It says nothing about what happens when the table has no SQL partition, whether errors or empty results are returned, or any permission requirements.

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

Conciseness4/5

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

A single front-loaded sentence with no redundant clauses. The parenthetical about line numbers and M context is the only slightly compressed part, since 'M context' is domain jargon an uninitiated agent may not parse, but it is short enough to justify its place.

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?

With an output schema present, the description need not explain return values, and the input schema fully covers all optional parameters. What is missing is the failure mode for tables lacking a SQL partition and confirmation that the operation is non-mutating, which matters given the sibling tool that writes the same field.

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 all three parameters (partition, workspace, table_name) are already documented, including the note that partition is only needed for multi-partition tables. The description adds nothing beyond echoing 'partition' and 'table', so the baseline of 3 applies.

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?

The description gives a specific verb ('Extract') and a specific resource ('partition SQL query ... for a table'), so it is immediately clear this is a read of SQL stored in a table partition. It does not name a sibling for contrast, but 'Extract' implicitly distinguishes it from 'update_table_sql'.

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?

Usage is only implied: an agent can infer this is the read-side counterpart of update_table_sql and relevant when a table has a Value.NativeQuery partition. There is no explicit statement of when to pick this tool over get_table or list_tables, and no exclusions or prerequisites.

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