Skip to main content
Glama

dax_suggest_rewrite

Apply safe mechanical rewrites to DAX expressions: divide becomes DIVIDE, remove trailing +0, collapse simple FILTERs, and get hints for unfixable findings along with the full updated expression.

Instructions

Concrete BEFORE/AFTER rewrites for a DAX expression's lint findings - pure offline, no session. Mechanical fixes are applied: 'a / b' -> DIVIDE(a, b), IFERROR(x / y, alt) -> DIVIDE(x, y, alt), a trailing '+ 0' removed, and FILTER(Table, single-column predicate) inside CALCULATE collapsed to the bare predicate. Findings with no safe mechanical fix (EARLIER, SUMMARIZE aggregations, nested CALCULATE, ...) come back as hint-only notes. Also returns the full suggested expression with every non-overlapping rewrite applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesthe DAX expression to rewrite
extraFunctionsNocomma-separated extra function names to accept as known
Behavior5/5

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

Without annotations, the description carries full burden, and it excels: states it is offline with no session, lists specific mechanical fixes, explains that unsafe findings become hint-only notes, and notes the return of the full suggested expression. This provides rich behavioral detail beyond the structured schema.

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?

The description is four sentences, front-loaded with the main purpose, and each sentence adds value by listing transformations and fallback behavior. It is slightly longer than the calibration high example but remains focused and well-structured.

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?

Without an output schema, it describes the key return value (full suggested expression) and the hint-only notes for non-mechanical findings. It does not detail the exact response structure, but given the complexity, the description is sufficiently complete for an agent to understand the tool's input and output.

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?

The schema already provides 100% coverage with descriptions for both 'expression' and 'extraFunctions'. The tool description does not add any additional parameter semantics beyond the schema, so the baseline of 3 applies.

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 it provides concrete BEFORE/AFTER rewrites for DAX lint findings, which distinguishes it from sibling tools like dax_lint or validate_dax. It specifies the action (rewrite) and resource (DAX expression's lint findings) with concrete examples.

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 phrase 'for a DAX expression's lint findings' implies when to use it, and 'pure offline, no session' gives a clear context. However, it does not explicitly name alternative tools or state when not to use it, which would make it a 5.

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