--- name: appfabriek-diagnose description: Diagnose a Microsoft Dynamics 365 Business Central online environment with Appfabriek Diagnose through the Business Central MCP server (tools named List_Findings_PAG11366962 and so on). Use when someone asks what is wrong in Business Central, why a job queue entry fails or hangs, why users cannot post, which number series run out, what changed in setup, which apps and versions are installed, or wants a diagnostic report or a comparison of sandbox and production. Read-only. --- # Appfabriek Diagnose for Business Central You read a Business Central online environment through the MCP server of Business Central (`https://mcp.businesscentral.dynamics.com`) and the MCP configuration *Appfabriek Diagnose*. Everything is read-only. You act as the signed-in user, with that user's permissions in Business Central. Docs: https://appfabriek.com/diagnose/docs/ · Support: https://appfabriek.com/diagnose/support/ ## The tools The MCP server makes a tool of each API page. Some clients put the server name in front (`mcp__bc-diagnose__List_Findings_PAG11366962`); the part after the server name is the same. | Tool | Returns | Use it for | |---|---|---| | `List_Findings_PAG11366962` | the diagnostic report: `severity` (Error, Warning, Info), `check`, `findingArea`, `title`, `details`, `advice`, `pageId`, `recordId` | always first | | `List_EnvironmentInfo_PAG11366963` | rows `category`/`name`/`value`/`detail`: environment name and type (Sandbox or Production), tenant, company, user, server time (UTC), work date, Base Application version, Diagnose version; then one row per installed app (`category` `app`: name, version, publisher and app ID) | always second; versions; comparing environments | | `List_JobQueueEntries_PAG11366964` | every job queue entry: status, error message, user, earliest start, last ready state, session started, recurring, minutes between runs, category, attempts. No parameter strings (they can hold secrets) | failing, hanging or missing jobs | | `List_JobQueueLogEntries_PAG11366965` | job queue log, newest first: start and end, object, description, status, error message, user | what happened at each run | | `List_ChangeLogEntries_PAG11366966` | change log, newest first: date and time, user, table, field, type of change, old and new value. Secret fields and keys come back as `***` | who changed what, and when. Only works if the change log is activated | | `List_ErrorMessages_PAG11366967` | stored error messages (only those in an error message register), newest first: created on, type, message, additional information, table, field, context | errors users got in posting and validation | | `List_SetupSnapshot_PAG11366968` | every normal field of Company Information, General Ledger Setup, Sales & Receivables Setup, Purchases & Payables Setup, Inventory Setup, Warehouse Setup and Change Log Setup, as `category` (table caption) / `name` (field caption) / `value`, with `detail` = `.`. Secrets as `***` | setup questions; comparing environments | If the admin allowed data queries, there are also the *Data Query Tools* of Microsoft (`bc_data_find_tables`, `bc_data_get_table_schema`, `bc_data_get_table_relations`, `bc_data_query`). They read other tables, within the user's permissions. They do not work on virtual tables. **Arguments.** `top` (at most 50 rows per call), `skip` for the next page, and `filter` with an OData filter, for example `severity eq 'Error'`, `name eq 'type'` or `status eq 'Error'`. Ask for fewer rows rather than more. Dates and times are UTC. **Values.** Option values come back with their AL names. A space can come back as `_x0020_` (`In_x0020_Process`). `recordId` and `pageId` say where the problem is and which page fixes it. ## How to build a diagnosis 1. **`findings`.** Read all of them (page on with `skip` if you get 50). Sort by severity: Error, then Warning, then Info. One row "No problems found" means every check passed. A finding "The check … could not run" means that check failed; the details hold the error. 2. **`environmentInfo`.** Note the environment name and type (Sandbox or Production), the company, the Base Application version, the Diagnose version and the server time. Use the server time to turn the time in a report from a user into UTC. 3. **Go deeper only where the findings or the question point:** - job failed or hangs: `jobQueueEntries` (filter on status), then `jobQueueLogEntries` around the time; - an error a user saw: `errorMessages`, then `jobQueueLogEntries`; - "it worked yesterday": `changeLogEntries` since that time, then `setupSnapshot`; - posting blocked: the finding about posting dates, then `setupSnapshot` (General Ledger Setup) and the change log for *Allow Posting From* and *Allow Posting To*; - a version question: the `app` rows of `environmentInfo`. 4. **Use the Data Query Tools only** when the seven tools do not answer the question, and say which table you read. 5. **Stop when you have the cause.** Do not read more than you need. ## How to write the report - One line at the top: environment, type, company, time (UTC), and how many errors, warnings and infos. - Then the findings, worst first. For each: what is wrong, the cause as far as the data shows it, what to do (start from `advice`), and the page in Business Central where it is fixed (the page of `pageId`, by name: Job Queue Entries, No. Series, General Ledger Setup, User Setup, Accounting Periods, Change Log Setup, Users, Company Information, Error Message Register, Job Queue Log Entries). - Keep facts and guesses apart. Quote the error message as it is. - Group findings that have one cause (ten failed jobs with the same error are one problem). - Leave out what is fine, unless the user asked. - Never show values that came back as `***`, and do not try to get them another way. - The user's language: answer in the language of the question. ## Comparing environments With two MCP servers that differ only in `EnvironmentName` (for example `bc-diagnose-sandbox` and `bc-diagnose-production`), ask both the same thing and report the differences: - `environmentInfo`: Base Application version, Diagnose version, and the apps (missing in one, other version); - `setupSnapshot`: match rows on `detail` (table and field number) and list the values that differ; - `findings`: what is wrong in one environment and not in the other. Say which server is which, and treat production with care: it is the real data. ## What this skill does not do - **It changes nothing.** The configuration has no tools that write. Do not suggest workarounds that write through other tools or other MCP servers. Tell the user what to change and on which page, and let a person do it in Business Central. - It does not see active sessions: Business Central online does not show them to apps. - It sees only what the signed-in user may read. Missing rows can mean missing permissions (permission set `AFB DIAGNOSE`). ## When a tool is missing or fails - A `List_…` tool is missing, for example after an update: an admin runs the assisted setup *Set up Appfabriek Diagnose for AI assistants* again. - Access denied or no rows where you expect them: the user needs the permission set `AFB DIAGNOSE`. - Sign-in fails: see https://appfabriek.com/diagnose/docs/#troubleshooting.