skills/query-records/SKILL.md
Query Dynamics 365 records using natural language. Translates questions into OData queries with metadata-aware field selection.
npx skillsauth add nickmeron/Dataverse-MCP-Server skills/query-recordsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The user wants to query data from Dynamics 365. Your job is to translate their natural language request into an effective OData query — using actual metadata from their environment to get the field names right.
Argument provided: $ARGUMENTS
Select environment — call list_environments, ask the user, call select_environment.
Identify the entity — if the name is ambiguous, call list_entities to find the correct one. Remember: query_records needs the EntitySetName (plural, e.g. accounts), not the LogicalName.
Discover the schema — call get_entity_attributes on the entity to see the actual field names, types, and which are required. This is critical — don't guess field names.
For picklist filters — if the user says something like "active accounts" or "open opportunities", call get_picklist_options for the relevant status field (e.g. statecode, statuscode) to get the correct integer values for filtering.
Build the OData query using the real field names:
$select — only the fields you need (use LogicalName from metadata)$filter — conditions using correct field names and types$orderby — sorting$top — limit (default 20 unless user specifies)$expand — for lookups, use the navigation property name from relationshipsCall query_records and present results in a clean, readable table — NOT raw JSON.
| User says | EntitySetName | LogicalName |
|---|---|---|
| accounts / companies | accounts | account |
| contacts / people | contacts | contact |
| leads | leads | lead |
| opportunities / deals | opportunities | opportunity |
| cases / tickets | incidents | incident |
| orders | salesorders | salesorder |
| invoices | invoices | invoice |
| products | products | product |
| activities / tasks | activitypointers | activitypointer |
| emails | emails | email |
statecode eq 0contains(name,'Contoso') or name eq 'Contoso'createdon ge 2024-01-01T00:00:00Zemailaddress1 ne null_parentaccountid_value eq {guid}get_picklist_optionsname eq 'Contoso'$filter use the _fieldname_value format$expand use the navigation property name (from relationships)testing
Create, monitor, and manage bulk deletion jobs in Dynamics 365. Use when asked "bulk delete", "delete all records of type X", "create a bulk delete job", "check bulk delete status", "cancel bulk delete", "why did bulk delete fail".
data-ai
Produce a business-readable summary of a Dynamics 365 record or set of records. Uses metadata to understand the schema before querying.
testing
Investigate users, security roles, teams, and permissions in Dynamics 365. Use when asked "who has access to...", "what roles does X have?", "compare roles", or "show me users".
tools
Pack, unpack, clone, and manage Dynamics 365 solutions using the PAC CLI. Use when asked "unpack solution", "pack solution", "clone solution", "source control my solution", "compare solution files".