Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_SERVER_MODENoServer mode: 'read-write', 'write-only', or 'read-only'. Defaults to 'read-write'.read-write
D365FO_SOLUTIONS_PATHYesPath to the Visual Studio solution directory for D365FO projects.
D365FO_WORKSPACE_PATHYesPath to the D365FO workspace (e.g., AosService\PackagesLocalDirectory\YourPackageName\YourModelName).

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{}
logging
{}
prompts
{}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
searchA

Search pre-indexed D365FO objects by name or keyword. Three modes in ONE tool: • single (default) → pass query; returns name, type, model. • batch → pass queries[] (max 10) to run searches in parallel (3× faster, with dedup + cross-reference). • extensions → set scope:"extensions" to restrict to custom/ISV models only (filters out Microsoft standard code). Model names in those results are SOURCE models — never use them as create/modify targets. Use get_object_info(objectType, name) when you already know the exact name and need full details.

generate_objectA

Generate X++/AOT code. Choose a mode: • pattern → a named X++ skeleton from the pattern enum (text only, no write). Call analyze_code(mode="patterns") first, then generate_object(mode="pattern"), then d365fo_file(action="create"). • scaffold → pattern-aware whole-object generation (table/form/report) with intelligent field/index/relation or form-pattern suggestions; set objectType. • find-methods → find()/findRecId()/exists() for a table (text), keyed on its primary/unique index. • relation-xpp → a table's relation(s) → X++ select + QueryBuildRange (text). • fields → field names → AxTableField XML with auto-resolved EDTs + optional field group. • table-relation → EDT-referencing fields → AxTableRelation XML (inverse of relation-xpp). 📖 Mode parameters are NOT inlined here: get_knowledge(kind="op-spec", topic="") — "scaffold:table"/"scaffold:form"/"scaffold:report" for the scaffolds — returns the contract; pass its values nested in params. For a single existing object definition's XML use d365fo_file(action="generate") instead.

analyze_codeA

Learn from the existing codebase. Choose a mode: • patterns → common classes/methods/dependencies for a scenario (call BEFORE generate_object(mode="pattern")). • implementations → real implementation examples of a similar method (actual code). • completeness → missing standard methods on a class (find/exist/validate gaps). • api-usage → how an API/class is initialized and called in practice.

d365fo_fileA

Create, modify, or generate a D365FO AOT object. Choose an action: • create → write a NEW object file into PackagesLocalDirectory (UTF-8 BOM, auto-added to .rnrproj). THE WRITE STEP — incomplete until isError=false; ⚠️/❌ = failure. Extensions: objectName="Base.PrefixExtension". • modify → edit an EXISTING object. APPLIES IMMEDIATELY, no dry-run — confirm with the user first; revert with undo_last_modification. Needs operation. • generate → XML as TEXT only, no write (Azure/Linux fallback). Try create first. create/modify need Windows. 📖 Parameters are NOT inlined here: get_knowledge(kind="op-spec", topic=""|"") returns the contract for the one you picked — pass its values nested in params (modify) / properties (create), along with any packageName/packagePath/solutionPath/workspacePath override. Model + prefix auto-applied. Classes: member vars inside the class { }, methods after the closing }.

find_referencesA

Find all references (where-used) to a class, method, field, table, enum, or LABEL. Essential for impact analysis before refactoring. For a method, SCOPE it to its declaring type — pass "Owner.method" (e.g. "SalesTable.initFromSalesQuotationTable"), set ownerName alongside a bare method name, or pass an AOT path ("/Tables/SalesTable/Methods/initFromSalesQuotationTable"). A bare method name (no owner) matches that name on every type and over-reports. For a label, pass the label id as targetName (e.g. "@WAX2194" or "@MyLabelFile:MyLabel"); results span every referencing object type (tables, forms, EDTs, enums, reports, menu items, …), not just code, and require the xref database (DYNAMICSXREFDB, full server mode).

get_object_infoA

Read D365FO object metadata. For 2+ objects pass objects:[{objectType,objectName},…] (max 10) — ONE call, run in parallel, per-object sections back; never loop single calls. One object: {objectType, name}. Pick the kind via objectType: class, table, form, query, view, enum, edt, report, data-entity, menu-item, service, map, config-key, security-policy, macro. Extension types (table-extension, form-extension, enum-extension, edt-extension, data-entity-extension) list all extensions of a base object — pass the base object name or a full extension name (the dot suffix is stripped automatically). Type-specific flags go in options. For CLASSES, {"members":"names"} (optional {"prefix":...}) returns a fast IntelliSense-style member-name list instead of full metadata. Replaces the former get__info, code_completion, batch_get_info and get_method tools.

labelsA

Unified label operations — read and write. Choose an action: • search → full-text query across indexed label files. • info → all translations for a labelId; without labelId lists label files (with labelFileId: physical .label.txt path per language). • create → add a new label to an AxLabelFile across every language .label.txt (write). Label IDs describe MEANING — never add a model prefix; target the model's ORIGINAL label file, never an …_Extension… file. Pass createIfMissing=true to reuse an existing label instead of reporting it — one call, no search first. Bulk: pass labels:[{labelId, translations}, …] with shared labelFileId/model at top level. • update → overwrite the text of an EXISTING label; same args as create with corrected translations[] (write). • rename → rename a label ID across .label.txt + X++ + XML + index. Use dryRun=true first (write). Write plumbing (paths, languages, sortLabels, allowExtensionLabelFile…) is auto-resolved; override it via get_knowledge(kind="op-spec", topic="labels").

object_patternsA

Pattern toolkit. Choose a domain: • table → common field types, index patterns and relation structures for D365FO tables. Filter by tableGroup (Main, Transaction, …) or similarTo a given table. • form → form-pattern toolkit; pick an action:

  • analyze → pattern advisor + usage analysis. RECOMMEND (preferred for a new form): pass recommend={entityKind, hasHeaderLines, fieldCount, usageIntent, tableName} for the right pattern via the Microsoft decision tree + reference forms to clone. Or filter by formPattern / dataSource / similarTo.

  • spec → full structure spec of a pattern or sub-pattern (required hierarchy/ordering, allowed children, reference forms, lifecycle). Call after analyze, before building.

  • validate → structural validator of AxForm XML (<50 ms, offline): container hierarchy/order, sub-patterns, PatternVersion. Returns FP001-FP010 violations. Call before action=create on d365fo_file.

security_infoA

D365FO security lookup. Choose a mode: • artifact → details + full hierarchy of a named privilege/duty/role (Role → Duties → Privileges → Entry Points). • coverage → reverse chain for an object: which privileges/duties/roles grant access (object → menu items → privileges → duties → roles).

extension_infoA

D365FO extensibility analyzer. Choose a mode: • coc → Chain of Command extensions + event subscriptions for a class/table. Use before writing a CoC extension to check for conflicts. • events → event handler subscriptions (SubscribesTo, delegate +=) for a class/table. Use before adding handlers to check for duplicates. • table-merge → all extensions of a table across models + effective merged schema (base + extension fields/indexes/methods). • points → available extension points (CoC-eligible/replaceable methods, delegates, blocked methods) and which are already extended. • strategy → recommends the best extensibility mechanism for a goal (CoC, event handler, business event, data entity, …) with reasoning, risks, alternatives, next steps.

validate_object_namingA

Validate a proposed D365FO object name against naming conventions: extension naming, ISV prefix, type-specific suffixes, and conflict detection against the symbol index.

get_workspace_infoA

ALWAYS call FIRST at session start. Returns model name, package path, framework directory, project path, environment type, and EXTENSION_PREFIX. Flags placeholder model names and missing prefix. projectName/projectPath ONLY when the USER changed project. This is the authoritative source for target model — not search results.

verify_d365fo_projectA

Verify that D365FO objects exist on disk at the correct AOT path and are referenced in the .rnrproj project file. Use instead of PowerShell to check d365fo_file(action="create") results. Omit objects to verify the ENTIRE project: every object referenced in the .rnrproj is checked on disk (requires projectPath, or an auto-detected/configured project).

update_symbol_indexA

Index D365FO XML file(s) changed OUTSIDE this server (hand edit, Visual Studio, git checkout). Do NOT call after d365fo_file create/modify — those refresh the index on their way out, so a follow-up call is a wasted round trip. One genuine same-session case: a brand-new AxEdt/AxEnum you are about to name in a generate_object fieldsHint. Omit filePath for a bridge/cache refresh only (no symbol-DB indexing).

build_d365fo_projectA

Build a D365FO model with xppc.exe (compiles the ENTIRE model, not one project). Blocks until done — call ONCE per build, do NOT poll (wait:false = legacy polling mode). fullBuild:true fixes "not been successfully compiled since it was last changed" stale-symbol errors.

trigger_db_syncA

Run a D365FO database sync (SyncEngine.exe). Supports partial sync of specific tables — much faster than full-model sync. Use partial sync after adding/renaming fields or indexes on known tables. Pass projectPath to auto-extract tables from .rnrproj for smart partial sync. Use full sync only when unsure what changed.

run_bp_checkA

Run Microsoft Best Practices checker (xppbp.exe) on a D365FO project. Returns BP warnings and errors with rule codes (e.g. BPErrorLabelIsText, BPXmlDocNoDocumentationComments).

run_systest_classA

Execute a D365FO unit test class via SysTestConsole.exe. Needs an interactive console session — fails headless.

review_workspace_changesA

Code review of uncommitted X++ changes (git diff HEAD): BP violations, missing labels, CoC patterns. Windows/local mode only. NOT for verifying writes (use verify_d365fo_project + get_object_info instead). If the diff looks truncated, do NOT read .xml/.xpp via built-in tools — proceed with the visible portion or narrow the scope.

undo_last_modificationA

Safely roll back incorrectly generated code by restoring a file to its last committed state. If the file is tracked by git, runs git checkout HEAD — this discards ALL uncommitted changes to the file, not just the most recent edit (the "last modification" name is historical). If the file is untracked (newly created), deletes it.

Also re-syncs the symbol/label index to the restored content — prefer this over a manual git revert or editor undo, which leave the index stale and (for .xml/.xpp) can desync the VS 2022 in-memory model.

⚠️ Local companion tool: available only in write-only/local mode (Windows VM).

get_knowledgeA

X++ knowledge lookup. Choose a kind: • knowledge → queryable X++ rulebook: verified patterns, BP rules, AX2012→D365FO migration. Use BEFORE generating code. Topics incl.: select-statement, coc-authoring, bp-rules, sysoperation, event-handlers, workflow, number-sequences, security, sysda, form patterns. • error → diagnose a D365FO/X++ compiler or runtime error: structured root cause + step-by-step fix + corrected X++ example (TTS mismatch, UpdateConflict, CSUV1, SYS10028 missing next, overlayering, BP errors, …). Call this instead of guessing — X++ error semantics differ from C#/.NET. • op-spec → the parameter contract for ONE d365fo_file operation/objectType or ONE generate_object mode (topic = "add-index", "table", "scaffold:form", …). Those two tools deliberately do not ship their parameters inline; call this after picking the operation, before the call. Omit topic for the index of available topics.

validate_codeA

Static validator for generated X++/XML (paste the text). Choose a mode: • syntax → offline best-practice/BP validator (no xppbp.exe). Structured violations {rule, severity, line, excerpt, fix}. Covers select, CoC, BP and table-XML rules mined from standard models. • references → semantic reference resolver (index-only): verifies every type, field, method (incl. arity), enum, label and intrinsic (tableStr/fieldStr/…) EXISTS in the indexed codebase — catches hallucinated symbols before the compiler. codeType="xml-table" checks XML refs instead: EDT/enum/relation/extends/label. Call both AFTER generating, BEFORE writes; fix errors in the same turn. Write tools run references internally when GROUNDING_ENFORCE=true.

prepareA

ONE-call context aggregator + groundingToken (30-min TTL, required for extension/new-object writes when GROUNDING_ENFORCE=true). Choose a mode: • change → extending/modifying an EXISTING object: exact signature, existing CoC wrappers, eligibility, recommended strategy, naming, patterns. Replaces the analyze→search→info→generate loop. • create → a NEW object: collision check, naming with auto-prefix, similar objects, EDT suggestions, reusable labels, mined property defaults.

Prompts

Interactive templates invoked by user choice

NameDescription
xpp_system_instructionsSystem instructions for AI assistants (GitHub Copilot, Claude Code) when working with D365 Finance & Operations X++ development
xpp_create_file🔥 USE THIS WHEN CREATING D365FO FILES: Mandatory workflow for creating D365FO classes, tables, forms, enums. ALWAYS use d365fo_file(action="create") tool FIRST.
xpp_code_reviewReview X++ code for best practices and potential issues
xpp_explain_classGet a detailed explanation of an X++ class
xpp_extension_guideComplete guide for CoC (Chain of Command) extensions and event handlers in D365FO
xpp_security_guideD365FO security model creation guide: privilege, duty, role, and menu item workflow
xpp_sysoperation_guideSysOperation framework reference: DataContract + Controller + Service pattern for batch operations
xpp_data_entity_guideData entity development guide: OData, DMF, staging tables, computed columns

Resources

Contextual data attached and managed by the client

NameDescription
Workspace Context SnapshotCurated snapshot of the current work: active model/project, recently edited objects, uncommitted X++ changes and index freshness. Read this first to ground a session.
Active ObjectThe object the developer is most likely working on (most recently modified X++ file) enriched with its indexed metadata. Proxy for editor focus — MCP exposes roots, not the cursor.
Workspace StatisticsSymbol-index totals by type, indexed models and workspace file counts.
Workspace FilesList of X++ metadata files detected in the workspace (most recent first).
Recent Workspace ChangesUncommitted X++ object files (vs HEAD + untracked). Empty when not a git repo.

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/dynamics365ninja/d365fo-mcp-server'

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