Skip to main content
Glama
mafzaal

Dynamics 365 Finance & Operations MCP Server

by mafzaal

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DEBUGNoEnable debug modefalse
D365FO_TIMEOUTNoGeneral timeout in seconds60
D365FO_BASE_URLYesD365 F&O environment base URL (e.g., https://your-environment.dynamics.com)
D365FO_LOG_FILENoCustom log file path
D365FO_CACHE_DIRNoGeneral cache directory path
D365FO_CLIENT_IDNoAzure AD Client ID for D365 F&O authentication
D365FO_LOG_LEVELNoLogging level: DEBUG, INFO, WARNING, ERROR, CRITICALINFO
D365FO_TENANT_IDNoAzure AD Tenant ID for D365 F&O authentication
D365FO_VERIFY_SSLNoVerify SSL certificatestrue
D365FO_LABEL_CACHENoEnable label cachingtrue
D365FO_KEYVAULT_URLNoAzure Key Vault URL for credential storage
D365FO_LABEL_EXPIRYNoLabel cache expiry in minutes (default: 24 hours)1440
D365FO_CLIENT_SECRETNoAzure AD Client Secret for D365 F&O authentication
D365FO_MCP_HTTP_HOSTNoHTTP host for MCP server127.0.0.1
D365FO_MCP_HTTP_JSONNoEnable JSON response modetrue
D365FO_MCP_HTTP_PORTNoHTTP port for MCP server8000
D365FO_MCP_TRANSPORTNoMCP Server Transport: stdio, sse, http, streamable-httpstdio
D365FO_META_CACHE_DIRNoMetadata cache directory path
D365FO_USE_CACHE_FIRSTNoUse cache before making API callstrue
D365FO_CREDENTIAL_SOURCENoCredential source: 'environment' or 'keyvault'environment
D365FO_MCP_HTTP_STATELESSNoEnable stateless mode for HTTP transporttrue
D365FO_MCP_REQUEST_TIMEOUTNoIndividual request timeout in seconds30
D365FO_MCP_MAX_CONCURRENT_REQUESTSNoMaximum concurrent requests allowed10

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
d365fo_execute_sql_query

Execute a SELECT query against the D365FO metadata database to get insights from cached metadata.

IMPORTANT SAFETY NOTES:

  • Only SELECT queries are allowed (no INSERT, UPDATE, DELETE, DROP, etc.)

  • Query results are limited to 1000 rows maximum

  • Queries timeout after 30 seconds

  • Some sensitive tables may be restricted

AVAILABLE TABLES AND THEIR PURPOSE:

  • metadata_environments: D365FO environments and their details

  • global_versions: Global version registry with hash and reference counts

  • environment_versions: Links between environments and global versions

  • data_entities: D365FO data entities metadata

  • public_entities: Public entity schemas and configurations

  • entity_properties: Detailed property information for entities

  • entity_actions: Available OData actions for entities

  • enumerations: System enumerations and their metadata

  • enumeration_members: Individual enumeration values and labels

  • metadata_search_v2: FTS5 search index for metadata

EXAMPLE QUERIES:

  1. Get most used entities by category: SELECT entity_category, COUNT(*) as count FROM data_entities GROUP BY entity_category ORDER BY count DESC

  2. Find entities with most properties: SELECT pe.name, COUNT(ep.id) as property_count FROM public_entities pe LEFT JOIN entity_properties ep ON pe.id = ep.entity_id GROUP BY pe.id ORDER BY property_count DESC LIMIT 10

  3. Analyze environment versions: SELECT me.environment_name, gv.version_hash, ev.detected_at FROM metadata_environments me JOIN environment_versions ev ON me.id = ev.environment_id JOIN global_versions gv ON ev.global_version_id = gv.id

Use this tool to analyze metadata patterns, generate reports, and gain insights into D365FO structure.

Args: query: SQL SELECT query to execute. Must be a SELECT statement only. Query will be validated for safety before execution. limit: Maximum number of rows to return. Default is 100, maximum is 1000. format: Output format for results. 'table' for human-readable format, 'json' for structured data, 'csv' for spreadsheet-compatible format. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with query results

d365fo_get_database_schema

Get comprehensive schema information for the D365FO metadata database.

This tool provides detailed information about:

  • All database tables and their structures

  • Column definitions with types and constraints

  • Indexes and their purposes

  • Foreign key relationships

  • Table statistics (row counts, sizes)

  • FTS5 virtual table information

Use this tool to understand the database structure before writing SQL queries.

Args: table_name: Optional. Get schema for a specific table only. If omitted, returns schema for all tables. include_statistics: Include table statistics like row counts and sizes. include_indexes: Include index information for tables. include_relationships: Include foreign key relationships between tables. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with database schema

d365fo_get_table_info

Get detailed information about a specific database table including:

  • Column definitions with types, nullability, and defaults

  • Primary and foreign key constraints

  • Indexes and their characteristics

  • Table statistics (row count, size, last updated)

  • Sample data (first few rows)

  • Relationships to other tables

This tool is useful for exploring specific tables before writing queries.

Args: table_name: Name of the table to get information about (e.g., 'data_entities', 'public_entities', 'entity_properties'). include_sample_data: Include sample data from the table (first 5 rows). include_relationships: Include information about relationships to other tables. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with table information

d365fo_get_database_statistics

Get comprehensive database statistics and analytics including:

  • Overall database size and table counts

  • Record counts by table

  • Global version statistics

  • Environment statistics

  • Cache hit rates and performance metrics

  • Storage utilization analysis

  • Data distribution insights

Use this tool to understand the overall state and health of the metadata database.

Args: include_table_stats: Include per-table statistics (row counts, sizes). include_version_stats: Include global version and environment statistics. include_performance_stats: Include cache performance and query statistics. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with database statistics

d365fo_search_entities

Search for D365 F&O data entities using simple keyword-based search.

IMPORTANT: When a user asks for something like "Get data management entities" or "Find customer group entities", break the request into individual keywords and perform MULTIPLE searches, then analyze all results:

  1. Extract individual keywords from the request (e.g. "data management entities" → "data", "management", "entities")

  2. Perform separate searches for each significant keyword using simple text matching

  3. Combine and analyze results from all searches

  4. Look for entities that match the combination of concepts

SEARCH STRATEGY EXAMPLES:

  • "data management entities" → Search for "data", then "management", then find entities matching both concepts

  • "customer groups" → Search for "customer", then "group", then find intersection

  • "sales orders" → Search for "sales", then "order", then combine results

Use simple keywords, not complex patterns. The search will find entities containing those keywords.

Args: pattern: Simple keyword or text to search for in entity names. Use plain text keywords, not regex patterns. For multi-word requests like 'data management entities': 1) Break into keywords: 'data', 'management' 2) Search for each keyword separately: 'data' then 'management' 3) Run separate searches for each keyword 4) Analyze combined results. Examples: use 'customer' to find customer entities, 'group' to find group entities. entity_category: Filter entities by their functional category (e.g., Master, Transaction). data_service_enabled: Filter entities that are enabled for OData API access (e.g., for querying). data_management_enabled: Filter entities that can be used with the Data Management Framework (DMF). is_read_only: Filter entities based on whether they are read-only or support write operations. limit: Maximum number of matching entities to return. Use smaller values (10-50) for initial exploration, larger values (100-500) for comprehensive searches. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with matching entities

d365fo_get_entity_schema

Get the detailed schema for a specific D365 F&O data entity, including properties, keys, and available actions.

Args: entityName: The public name of the entity (e.g., 'CustomerV3'). include_properties: Set to true to include detailed information about each property (field) in the entity. resolve_labels: Set to true to resolve and include human-readable labels for the entity and its properties. language: The language to use for resolving labels (e.g., 'en-US', 'fr-FR'). profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with entity schema

d365fo_search_actions

Search for available OData actions in D365 F&O using simple keyword-based search.

IMPORTANT: When searching for actions, break down user requests into individual keywords and perform MULTIPLE searches:

  1. Extract keywords from requests (e.g., "posting actions" → "post", "posting")

  2. Perform separate searches for each keyword using simple text matching

  3. Combine and analyze results from all searches

  4. Look for actions that match the combination of concepts

SEARCH STRATEGY EXAMPLES:

  • "posting actions" → Search for "post", then look for posting-related actions

  • "validation functions" → Search for "valid" and "check", then find validation actions

  • "workflow actions" → Search for "workflow" and "approve", then combine results

Use simple keywords, not complex patterns. Actions are operations that can be performed on entities or globally.

Args: pattern: Simple keyword or text to search for in action names. Use plain text keywords, not regex patterns. For requests like 'posting actions': 1) Extract keywords: 'post', 'posting' 2) Search for each keyword: 'post' 3) Perform multiple searches for related terms 4) Analyze combined results. Use simple text matching. entityName: Optional. Filter actions that are bound to a specific data entity (e.g., 'CustomersV3'). bindingKind: Optional. Filter by binding type: 'Unbound' (can call directly), 'BoundToEntitySet' (operates on entity collections), 'BoundToEntityInstance' (requires specific entity key). isFunction: Optional. Filter by type: 'true' for functions (read-only), 'false' for actions (may have side-effects). Note: This filter may not be fully supported yet. limit: Maximum number of matching actions to return. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with matching actions

d365fo_search_enumerations

Search for enumerations (enums) in D365 F&O using simple keyword-based search.

IMPORTANT: When searching for enumerations, break down user requests into individual keywords and perform MULTIPLE searches:

  1. Extract keywords from requests (e.g., "customer status enums" → "customer", "status")

  2. Perform separate searches for each keyword using simple text matching

  3. Combine and analyze results from all searches

  4. Look for enums that match the combination of concepts

SEARCH STRATEGY EXAMPLES:

  • "customer status enums" → Search for "customer", then "status", then find status-related customer enums

  • "blocking reasons" → Search for "block" and "reason", then combine results

  • "approval states" → Search for "approval" and "state", then find approval-related enums

Use simple keywords, not complex patterns. Enums represent lists of named constants (e.g., NoYes, CustVendorBlocked).

Args: pattern: Simple keyword or text to search for in enumeration names. Use plain text keywords, not regex patterns. For requests like 'customer blocking enums': 1) Extract keywords: 'customer', 'blocking' 2) Search for each keyword: 'customer' then 'blocking' 3) Perform multiple searches 4) Analyze combined results. Use simple text matching. limit: Maximum number of matching enumerations to return. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with matching enumerations

d365fo_get_enumeration_fields

Get the detailed members (fields) and their values for a specific D365 F&O enumeration.

Args: enumeration_name: The exact name of the enumeration (e.g., 'NoYes', 'CustVendorBlocked'). resolve_labels: Set to true to resolve and include human-readable labels for the enumeration and its members. language: The language to use for resolving labels (e.g., 'en-US', 'fr-FR'). profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with enumeration details

d365fo_get_installed_modules

Get the list of installed modules in the D365 F&O environment with their details including name, version, module ID, publisher, and display name.

Args: profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with installed modules

d365fo_query_entities

Query D365FO data entities with simplified filtering capabilities.

Args: entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") select: List of field names to include in response filter: Simplified filter expression using only "eq" operation with wildcard support: - Basic equality: "FieldName eq 'value'" - Starts with: "FieldName eq 'value*'" - Ends with: "FieldName eq '*value'" - Contains: "FieldName eq 'value'" - Enum values: "StatusField eq Microsoft.Dynamics.DataEntities.EnumType'EnumValue'" Example: "SalesOrderStatus eq Microsoft.Dynamics.DataEntities.SalesStatus'OpenOrder'" order_by: List of field names to sort by (e.g., ["CreatedDateTime desc", "SalesId"]) top: Maximum number of records to return (default: 100) skip: Number of records to skip for pagination count: Whether to include total count in response expand: List of navigation properties to expand profile: Profile name for connection configuration

Returns: Dictionary with query results including data array, count, and pagination info

Note: This tool uses simplified OData filtering that only supports "eq" operations with wildcard patterns. For complex queries, retrieve data first and filter programmatically.

d365fo_get_entity_record

Get a specific record from a D365FO data entity.

Args: entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") key_fields: List of key field names for composite keys key_values: List of key values corresponding to key fields select: List of fields to include in response expand: List of navigation properties to expand profile: Optional profile name

Returns: Dictionary with the entity record

d365fo_create_entity_record

Create a new record in a D365 Finance & Operations data entity.

Args: entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") data: Record data containing field names and values return_record: Whether to return the complete created record profile: Optional profile name

Returns: Dictionary with creation result

d365fo_update_entity_record

Update an existing record in a D365 Finance & Operations data entity.

Args: entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") key_fields: List of key field names for composite keys key_values: List of key values corresponding to key fields data: Record data containing fields to update return_record: Whether to return the complete updated record profile: Optional profile name

Returns: Dictionary with update result

d365fo_delete_entity_record

Delete a record from a D365 Finance & Operations data entity.

Args: entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") key_fields: List of key field names for composite keys key_values: List of key values corresponding to key fields profile: Optional profile name

Returns: Dictionary with deletion result

d365fo_call_action

Execute an OData action method in D365 Finance & Operations.

Args: action_name: Full name of the OData action to invoke parameters: Action parameters as key-value pairs entity_name: The entity's public collection name or entity set name (e.g., "CustomersV3", "SalesOrders", "DataManagementEntities") key_fields: Primary key fields for entity-bound actions key_values: Primary key values for entity-bound actions profile: Optional profile name

Returns: Dictionary with action result

d365fo_call_json_service

Call a D365 F&O JSON service endpoint using the /api/services pattern.

This provides a generic way to invoke any JSON service operation in D365 F&O.

Args: service_group: Service group name (e.g., 'SysSqlDiagnosticService') service_name: Service name (e.g., 'SysSqlDiagnosticServiceOperations') operation_name: Operation name (e.g., 'GetAxSqlExecuting') parameters: Optional parameters to send in the POST body profile: Configuration profile to use

Returns: Dictionary with service response data and metadata

Example: Call a service without parameters: { "service_group": "SysSqlDiagnosticService", "service_name": "SysSqlDiagnosticServiceOperations", "operation_name": "GetAxSqlExecuting" }

Call a service with parameters:
{
    "service_group": "SysSqlDiagnosticService",
    "service_name": "SysSqlDiagnosticServiceOperations",
    "operation_name": "GetAxSqlResourceStats",
    "parameters": {
        "start": "2023-01-01T00:00:00Z",
        "end": "2023-01-02T00:00:00Z"
    }
}
d365fo_list_profiles

Get list of all available D365FO environment profiles.

Returns: Dictionary with list of profiles

d365fo_get_profile

Get details of a specific D365FO environment profile.

Args: profileName: Name of the profile to retrieve

Returns: Dictionary with profile details

d365fo_create_profile

Create a new D365FO environment profile with full configuration options.

Args: name: Profile name baseUrl: D365FO base URL description: Profile description verifySsl: Whether to verify SSL certificates (default: True) timeout: Request timeout in seconds (default: 60) useLabelCache: Whether to enable label caching (default: True) labelCacheExpiryMinutes: Label cache expiry in minutes (default: 60) useCacheFirst: Whether to use cache-first behavior (default: True) language: Default language code (default: "en-US") cacheDir: Custom cache directory path (optional) outputFormat: Default output format for CLI operations (default: "table") setAsDefault: Set as default profile (default: False) credentialSource: Credential source configuration. If None, uses Azure Default Credentials. Can be: - Environment variables: {"sourceType": "environment", "clientIdVar": "MY_CLIENT_ID", "clientSecretVar": "MY_CLIENT_SECRET", "tenantIdVar": "MY_TENANT_ID"} - Azure Key Vault: {"sourceType": "keyvault", "vaultUrl": "https://vault.vault.azure.net/", "clientIdSecretName": "D365FO_CLIENT_ID", "clientSecretSecretName": "D365FO_CLIENT_SECRET", "tenantIdSecretName": "D365FO_TENANT_ID"}

Returns: Dictionary with creation result

d365fo_update_profile

Update an existing D365FO environment profile with full configuration options.

Automatically invalidates all cached client connections to ensure they pick up the new profile settings on next use.

Args: name: Profile name baseUrl: D365FO base URL description: Profile description verifySsl: Whether to verify SSL certificates timeout: Request timeout in seconds useLabelCache: Whether to enable label caching labelCacheExpiryMinutes: Label cache expiry in minutes useCacheFirst: Whether to use cache-first behavior language: Default language code cacheDir: Custom cache directory path outputFormat: Default output format for CLI operations credentialSource: Credential source configuration. Set to null to use Azure Default Credentials. Can be: - Environment variables: {"sourceType": "environment", "clientIdVar": "MY_CLIENT_ID", "clientSecretVar": "MY_CLIENT_SECRET", "tenantIdVar": "MY_TENANT_ID"} - Azure Key Vault: {"sourceType": "keyvault", "vaultUrl": "https://vault.vault.azure.net/", "clientIdSecretName": "D365FO_CLIENT_ID", "clientSecretSecretName": "D365FO_CLIENT_SECRET", "tenantIdSecretName": "D365FO_TENANT_ID"}

Returns: Dictionary with update result including number of clients invalidated

d365fo_delete_profile

Delete a D365FO environment profile.

Automatically invalidates all cached client connections since the profile is no longer available.

Args: profileName: Name of the profile to delete

Returns: Dictionary with deletion result including number of clients invalidated

d365fo_set_default_profile

Set the default D365FO environment profile.

Automatically refreshes all cached client connections since changing the default profile may affect client resolution for operations that use the default profile.

Args: profileName: Name of the profile to set as default

Returns: Dictionary with result including client refresh status

d365fo_get_default_profile

Get the current default D365FO environment profile.

Returns: Dictionary with default profile

d365fo_validate_profile

Validate a D365FO environment profile configuration.

Args: profileName: Name of the profile to validate

Returns: Dictionary with validation result

d365fo_test_profile_connection

Test connection for a specific D365FO environment profile.

Args: profileName: Name of the profile to test

Returns: Dictionary with connection test result

d365fo_clone_profile

Clone an existing D365FO environment profile with optional modifications.

Args: sourceProfileName: Name of the profile to clone newProfileName: Name for the new profile description: Description for the new profile

Returns: Dictionary with cloning result

d365fo_export_profiles

Export all D365FO environment profiles to a file.

Args: filePath: Path where to export the profiles

Returns: Dictionary with export result

d365fo_import_profiles

Import D365FO environment profiles from a file.

Args: filePath: Path to the file containing profiles to import overwrite: Whether to overwrite existing profiles with the same name

Returns: Dictionary with import results

d365fo_search_profiles

Search D365FO environment profiles based on criteria.

Args: pattern: Pattern to match in profile name, description, or base URL hasCredentialSource: Filter by presence of credential source (True=has credential source, False=uses default credentials) credentialSourceType: Filter by credential source type ("environment", "keyvault")

Returns: Dictionary with matching profiles

d365fo_get_profile_names

Get list of all D365FO environment profile names.

Returns: Dictionary with profile names

d365fo_start_sync

Start a metadata synchronization session and return a session ID for tracking progress.

This downloads and caches metadata from D365 F&O including entities, schemas, enumerations, and labels.

Args: strategy: Sync strategy to use. 'full' downloads all metadata, 'entities_only' downloads just entities for quick refresh, 'labels_only' downloads only labels, 'full_without_labels' downloads all metadata except labels, 'sharing_mode' copies from compatible versions, 'incremental' updates only changes (fallback to full). global_version_id: Specific global version ID to sync. If not provided, will detect current version automatically. profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with sync session details

d365fo_get_sync_progress

Get detailed progress information for a specific sync session including current phase, completion percentage, items processed, and estimated time remaining.

Args: session_id: Session ID of the sync operation to check progress for profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with sync progress

d365fo_cancel_sync

Cancel a running sync session. Only sessions that are currently running and marked as cancellable can be cancelled.

Args: session_id: Session ID of the sync operation to cancel profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with cancellation result

d365fo_list_sync_sessions

Get a list of all currently active sync sessions with their status, progress, and details.

Args: profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with active sync sessions

d365fo_get_sync_history

Get the history of completed sync sessions including success/failure status, duration, and statistics.

Args: limit: Maximum number of historical sessions to return (default: 20, max: 100) profile: Configuration profile to use (optional - uses default profile if not specified)

Returns: Dictionary with sync history

d365fo_get_label

Get label text by label ID.

Args: labelId: Label ID (e.g., @SYS1234) language: Language code for label text fallbackToEnglish: Fallback to English if translation not found profile: Optional profile name

Returns: Dictionary with label text

d365fo_get_labels_batch

Get multiple labels in a single request.

Args: labelIds: List of label IDs to retrieve language: Language code for label texts fallbackToEnglish: Fallback to English if translation not found profile: Optional profile name

Returns: Dictionary with label texts

d365fo_download_srs_report

Download SQL Server Reporting Services (SSRS/SRS) reports from D365 Finance & Operations as PDF files.

This tool generates and downloads business documents like invoices, purchase orders, confirmations, and other reports by calling the D365FO SRS reporting engine. The report is returned as a PDF file saved to a specified location.

Args: document_id: The unique identifier/key of the document (e.g., 'CIV-000708', 'SO-001234') legal_entity: The legal entity/company code (DataAreaId) where the document exists (e.g., 'USMF') controller_name: The SSRS controller class name (default: 'SalesInvoiceController') Common controllers: - SalesInvoiceController: Customer invoices - FreeTextInvoiceController: Free text invoices - CustDebitCreditNoteController: Debit/credit notes - SalesConfirmController: Sales confirmations - PurchPurchaseOrderController: Purchase orders data_table: The database table containing the document (default: 'CustInvoiceJour') data_field: The field name that stores the document ID (default: 'InvoiceId') document_type: Human-readable document type for filename (default: 'SalesInvoice') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Common controller/table/field combinations: | Controller | Table | Field Name | Field Type | Document Type | |-----------|-------|-----------|------------|---------------| | SalesInvoiceController | CustInvoiceJour | InvoiceId | Invoice ID | Sales Invoice | | FreeTextInvoiceController | CustInvoiceJour | InvoiceId | Invoice ID | Free Text Invoice | | CustDebitCreditNoteController | CustInvoiceJour | InvoiceId | Invoice ID | Debit/Credit Note | | SalesConfirmController | CustConfirmJour | ConfirmId or SalesId | Confirm/Sales ID | Sales Confirmation | | PurchPurchaseOrderController | VendPurchOrderJour | PurchId | Purchase Order ID | Purchase Order | Returns: Dictionary with download result including saved file path

d365fo_download_customer_invoice

Download a customer invoice report as PDF from D365 Finance & Operations.

This is a convenience tool with preset configurations for customer invoices. Use this when you need to quickly download customer invoices without specifying all the technical parameters.

To find available invoices to download, query the Customer Invoice Journal entity:

  • Entity name: CustInvoiceJourBiEntity

  • Collection name: CustInvoiceJourBiEntities

  • Key fields: InvoiceId, InvoiceDate, InvoiceAccount, InvoiceAmount, SalesType, dataAreaId

  • Use d365fo_query_entities tool to search for invoices

Example query to find invoices: d365fo_query_entities( entityName="CustInvoiceJourBiEntities", filter="InvoiceDate ge 2024-01-01", select=["InvoiceId", "InvoiceDate", "InvoiceAccount", "InvoiceAmount", "SalesType"] )

Args: invoice_id: The customer invoice number/ID (e.g., 'CIV-000708', 'INV-2024-001') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Returns: Dictionary with download result including saved file path

d365fo_download_free_text_invoice

Download a free text invoice report as PDF from D365 Finance & Operations.

This is a convenience tool specifically configured for free text invoices using the FreeTextInvoiceController. Free text invoices are customer invoices that don't originate from sales orders.

To find available invoices to download, query the Customer Invoice Journal entity:

  • Entity name: CustInvoiceJourBiEntity

  • Collection name: CustInvoiceJourBiEntities

  • Key fields: InvoiceId, InvoiceDate, InvoiceAccount, InvoiceAmount, SalesType, dataAreaId

  • Use d365fo_query_entities tool to search for invoices

Example query to find free text invoices: d365fo_query_entities( entityName="CustInvoiceJourBiEntities", filter="InvoiceDate ge 2024-01-01", select=["InvoiceId", "InvoiceDate", "InvoiceAccount", "InvoiceAmount", "SalesType"] )

Args: invoice_id: The free text invoice number/ID (e.g., 'FTI-00000021', 'FTI-2024-001') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Returns: Dictionary with download result including saved file path

d365fo_download_debit_credit_note

Download a debit/credit note report as PDF from D365 Finance & Operations.

This is a convenience tool specifically configured for debit and credit notes using the CustDebitCreditNoteController. These are adjustment documents for customer invoices.

To find available documents to download, query the Customer Invoice Journal entity:

  • Entity name: CustInvoiceJourBiEntity

  • Collection name: CustInvoiceJourBiEntities

  • Key fields: InvoiceId, InvoiceDate, InvoiceAccount, InvoiceAmount, SalesType, dataAreaId

  • Use d365fo_query_entities tool to search for invoices

Example query to find invoices: d365fo_query_entities( entityName="CustInvoiceJourBiEntities", filter="InvoiceDate ge 2024-01-01", select=["InvoiceId", "InvoiceDate", "InvoiceAccount", "InvoiceAmount", "SalesType"] )

Args: invoice_id: The debit/credit note invoice ID (e.g., 'DN-000123', 'CN-000456') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Returns: Dictionary with download result including saved file path

d365fo_download_sales_confirmation

Download a sales confirmation report as PDF from D365 Finance & Operations.

This is a convenience tool specifically configured for sales order confirmations using the SalesConfirmController. Sales confirmations are documents sent to customers to confirm sales orders.

To find available confirmations to download, query the Sales Order Confirmation Headers entity:

  • Entity name: SalesOrderConfirmationHeaderEntity

  • Collection name: SalesOrderConfirmationHeaders

  • Key fields: ConfirmationNumber, SalesOrderNumber, ConfirmationDate, OrderingCustomerAccountNumber, TotalConfirmedAmount, dataAreaId

  • Use d365fo_query_entities tool to search for confirmations

Example query to find confirmations: d365fo_query_entities( entityName="SalesOrderConfirmationHeaders", filter="ConfirmationDate ge 2024-01-01", select=["ConfirmationNumber", "SalesOrderNumber", "ConfirmationDate", "OrderingCustomerAccountNumber", "TotalConfirmedAmount"] )

Args: confirmation_id: The confirmation ID or sales order ID (e.g., 'SC-000123', 'SO-001234') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Returns: Dictionary with download result including saved file path

d365fo_download_purchase_order

Download a purchase order report as PDF from D365 Finance & Operations.

This is a convenience tool specifically configured for purchase orders using the PurchPurchaseOrderController. Purchase orders are documents sent to vendors to order goods or services.

To find available purchase orders to download, query the Purchase Order Confirmation Headers entity:

  • Entity name: PurchPurchaseOrderConfirmationHeaderEntity

  • Collection name: PurchaseOrderConfirmationHeaders

  • Key fields: PurchaseOrderNumber, ConfirmationNumber, ConfirmationDate, OrderVendorAccountNumber, TotalConfirmedAmount, dataAreaId

  • Use d365fo_query_entities tool to search for purchase orders

Example query to find purchase orders: d365fo_query_entities( entityName="PurchaseOrderConfirmationHeaders", filter="ConfirmDate ge 2024-01-01", select=["PurchaseOrderNumber", "ConfirmDate", "VendorAccount", "OrderStatus"] )

Args: purchase_order_id: The purchase order ID (e.g., 'PO-000123', 'P00001234') legal_entity: The legal entity/company code (e.g., 'USMF', 'DEMF') save_path: Full path where PDF should be saved (optional, auto-generates if not provided) profile: Configuration profile name (default: 'default')

Returns: Dictionary with download result including saved file path

d365fo_test_connection

Test connection to D365FO environment.

Args: profile: Optional profile name to test (uses default if not specified)

Returns: JSON string with connection test results

d365fo_get_environment_info

Get D365FO environment information and version details.

Args: profile: Optional profile name (uses default if not specified)

Returns: JSON string with environment information

d365fo_get_server_performance

Get FastMCP server performance statistics and health metrics.

Returns: Dict with server performance data

d365fo_reset_performance_stats

Reset server performance statistics.

Returns: Dict with reset confirmation

d365fo_get_server_config

Get current FastMCP server configuration and feature status.

Returns: Dict with server configuration

Prompts

Interactive templates invoked by user choice

NameDescription
d365fo_entity_analysisAnalyze a D365FO data entity structure and provide insights. Args: entity_name: Name of the entity to analyze Returns: Analysis prompt text
d365fo_environment_summaryGenerate a summary of the D365FO environment. Returns: Environment summary prompt text

Resources

Contextual data attached and managed by the client

NameDescription
environment_metadataGet D365FO environment metadata. Returns: JSON string with environment information
profiles_resourceGet all available profiles. Returns: JSON string with profiles list

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/mafzaal/d365fo-client'

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