Skip to main content
Glama

value_nativequery_folding

Run a native SQL query against a source while preserving downstream query folding, ensuring continued performance optimization in Power Query.

Instructions

Run a native query against a source and KEEP downstream folding alive: Value.NativeQuery(sourceExpr, nativeQuery, params, [EnableFolding=true]). sourceExpr is raw M (e.g. a Sql.Database(...) reference). paramsExpr is an optional raw M parameter record/list. Appends one step to the table's M query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
sessionIdYes
paramsExprNooptional raw M parameter record/list (default null)
sourceExprYesthe source as raw M, e.g. Sql.Database("srv","db")
nativeQueryYesthe native (SQL) query text
partitionNameNopartition name (optional; defaults to the first partition)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool appends a step to the table's M query, uses raw M expressions, and keeps folding alive. It does not mention potential side effects or safety aspects of running a native query, but the key behavioral trait is well covered.

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?

Two sentences, front-loaded with the key purpose, and includes the exact M function signature. No wasted words; every sentence adds value.

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?

Given the tool's complexity and lack of annotations/output schema, the description is fairly complete. It explains the M syntax, parameter roles, and the effect on the table's M query. It does not mention return values, but for a tool that modifies the M query this may not be critical.

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 coverage is 67% with descriptions for sourceExpr and nativeQuery. The description adds clarity for sourceExpr (raw M, e.g., Sql.Database) and paramsExpr (optional raw M record/list), but does not explain table, sessionId, or partitionName beyond the schema. It adds some value but does not fully compensate for the missing parameter documentation.

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 runs a native query and keeps downstream folding alive, using a specific verb and resource. It distinguishes itself from sibling tools like set_stop_folding by explicitly mentioning the folding-preservation behavior.

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

Usage Guidelines4/5

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

The description implies when to use this tool: when a native query is needed and folding should be preserved. It does not explicitly name alternatives or state when not to use it, but the context is clear from the phrase 'KEEP downstream folding alive'.

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/cyphonica/powerbi-pbix-mcp'

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