Skip to main content
Glama

sum_where

Conditionally sum a field expression in SSRS, adding values only when a condition is met.

Instructions

Emit =Sum(IIf(, , 0)) — the SSRS conditional-sum idiom. Both args are expression bodies (no leading '=').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionYesRDL expression body, e.g. 'Fields!Status.Value = "Active"'.
field_expressionYesValue to sum, e.g. 'Fields!Amount.Value'.
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains that the tool emits an expression but does not mention side effects, permissions, or return format. It adds a behavioral detail that arguments are expression bodies without leading '=', which is helpful but not comprehensive.

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?

The description is extremely concise, consisting of two short sentences. It front-loads the key formula and immediately provides critical formatting guidance. Every sentence adds value with no redundant information.

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?

Given the tool's simplicity (2 parameters, no output schema, no annotations), the description is complete. It fully explains what the tool does, how to construct the expression, and the exact format of inputs. No additional information is needed for an agent to correctly invoke this tool.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema. It explains that both parameters are expression bodies without leading '=' and provides concrete examples: 'e.g., ''Fields!Status.Value = "Active"''' for condition and 'e.g., ''Fields!Amount.Value''' for field_expression. This clarifies the expected format and usage, despite 100% 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?

The description clearly states the tool emits the SSRS conditional-sum idiom '=Sum(IIf(<condition>, <field_expression>, 0))', specifying the verb 'Emit' and the exact expression pattern. This distinguishes it from siblings like 'count_where' which handles a different aggregate.

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 includes a usage note that 'Both args are expression bodies (no leading '='),' which helps the agent format inputs correctly. While it doesn't explicitly state when to use this tool versus alternatives, the context of 'SSRS conditional-sum idiom' implies it is for conditional summation in SSRS reports. No exclusion criteria or alternative tools are mentioned.

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/mafaq229/pbirb-mcp'

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