Skip to main content
Glama
Dynamics 365 MCP Server

Dynamics 365 MCP Server

by Kenny-666

preview_fetchxml_query

Preview the first FetchXML query result with the same state and filter logic as a full query, returning the effective query and paging details without implying a complete result set.

Instructions

Preview the first result using the same FetchXML state/filter logic as query_by_fetchxml. Returns effective query and paging information without claiming the sample is a full result set.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fetch_xml": "<fetch_xml>"
    },
    "name": "preview_fetchxml_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
fetch_xmlYesThe FetchXML string to preview
state_modeNolegacy preserves valid implicit statecode=0 filtering; all adds no state filter; values uses state_values validated against this table.
state_valuesNoExplicit numeric state values; requires state_mode=values.
formatted_valuesNoInclude formatted labels and display values returned by CRM.
environment_profileNoOptional named environment profile for this call; omit to use the configured default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.1.2
    • addedInput schema / properties / environment_profile
      Added value: +{
      +  "description": "Optional named environment profile for this call; omit to use the configured default.",
      +  "pattern": "^[A-Za-z][A-Za-z0-9_]{0,31}$",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses that the tool returns effective query and paging information and that the sample is not a full result set, but it does not state read-only behavior, permission requirements, error behavior, or rate limits.

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 two tightly written sentences with the core behavior front-loaded. Every phrase contributes useful information: preview scope, shared logic with query_by_fetchxml, and the caveat about sample results.

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?

For a five-parameter preview query with no output schema, the description adequately explains what is returned at a high level: effective query and paging information plus a first-result sample. It is somewhat less complete on output shape and safety behavior, but the schema fully documents parameters.

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 five parameters, including state_mode and state_values, are already documented in the input schema. The description mentions the shared state/filter logic but does not add syntax or usage details beyond what the schema provides.

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 uses a specific verb (Preview) and resource (FetchXML query), and explicitly distinguishes the operation from the full sibling query_by_fetchxml. An agent can tell that this returns a first-result sample and paging/query metadata rather than a complete result set.

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?

It clearly implies when to use this tool: to preview the first result using the same state/filter logic as query_by_fetchxml. It names the related full-query alternative but does not explicitly state when not to use preview mode or any prerequisite conditions.

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

Deploy Server

Other Tools