-
Notifications
You must be signed in to change notification settings - Fork 16
mcp_execute_fetchxml
PhuocLe edited this page Jun 20, 2026
·
3 revisions
| Field | Value |
|---|---|
| Tool name | execute_fetchxml |
| MCP title | Run a FetchXML query |
| Category | basic |
| Implementation | DynamicsCrm.DevKit.Cli/Mcp/Tools/ExecuteFetchXmlTool.cs |
| Estimated token count | ~208 tokens (tools/list tool JSON, o200k_base, measured 2026-06-18) |
| Last verified | 2026-06-18 |
Run FetchXML query → markdown table. Max 5000 records, auto-paging supported. Lowercase logical names (use get_tables to verify). Don't use top/count/page in <fetch>; use max_records. See schema://fetchxml for syntax.
WHEN TO USE:
- Precise filtering / joins / aggregation across entities
- When search_records (Relevance Search) is too coarse or not enabled
- get_all=true to fetch full datasets up to max_records
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fetchxml |
string |
Yes | - |
FetchXML starting with . Lowercase logical names. |
max_records |
integer |
No | 5000 |
1–5000. Smaller (10–100) for samples. |
get_all |
boolean |
No | false |
true = auto-page till max_records. false = first page only. |
{
"type": "object",
"properties": {
"fetchxml": {
"type": "string",
"description": "FetchXML starting with <fetch>. Lowercase logical names."
},
"max_records": {
"type": "integer",
"description": "1–5000. Smaller (10–100) for samples.",
"default": 5000
},
"get_all": {
"type": "boolean",
"description": "true = auto-page till max_records. false = first page only.",
"default": false
}
},
"required": [
"fetchxml"
]
}| Resource | URI / URI template | MIME type | Reason |
|---|---|---|---|
fetchxml_schema |
schema://fetchxml |
application/xml |
Mentioned in MCP metadata: Returns the XML schema defining the FetchXML query language. Structure: fetch > entity > attribute, filter, link-entity, order. Note: The execute_fetchxml tool description already provides a curated guide. This schema is for advanced/edge cases. |
data_operations_guide |
docs://data_operations_guide |
text/markdown |
Inferred from source: Field type formats, FetchXML relationship joins, and search syntax. Read this when manage_record, execute_fetchxml, or search_records returns an error. |
- Precise filtering / joins / aggregation across entities
- When search_records (Relevance Search) is too coarse or not enabled
- get_all=true to fetch full datasets up to max_records
- Use the exact MCP description and parameter schema above as the authoritative contract.
{
"fetchxml": "string"
}Returns CallToolResult from the MCP server. The response content and structured fields follow the tool implementation and model returned by ExecuteFetchXmlTool.execute_fetchxml.
- "Run this FetchXML query for active accounts and return a compact markdown table."
- "Query contacts joined to their parent accounts and limit the result to 50 records."
- "Use FetchXML to aggregate opportunities by owner and explain the returned totals."