Reference manual

MCP server

Prism for C/AL runs a Model Context Protocol (MCP) server. An AI agent connected to it searches your exported C/AL objects through Prism's symbol index: it finds objects and members, reads their code, follows references, calls and object dependencies, and checks that an edited object still parses. The server only reads your objects; it never changes them.

HTTP STDIO 11 tools · 7 resources AI agent VS Code Claude Code Other client MCP Server pagehttp://localhost:47821In the workspace window Open object storeFile, folder or mirror StaticalPrismCALCmd.exemcp-server-stdio <path>Started by the agent Object text fileor folder at <path> HTTP STDIO 11 tools · 7 resources AI agent VS Code Claude Code Other client MCP Server pagehttp://localhost:47821In the workspace window Open object storeFile, folder or mirror StaticalPrismCALCmd.exemcp-server-stdio <path>Started by the agent Object text file or folderAt <path>
The two ways an agent reaches Prism's MCP server, and what comes back.

An agent reaches the server in one of two ways:

TransportWho starts the serverPrism windowSymbol index
HTTP You: with Start on the MCP Server page, or with StaticalPrismCALCmd.exe mcp-server-http. Needed for the page's server; not for the command-line one. Shared by every connected agent, and ready as soon as the store is open.
stdio The agent, from its MCP configuration, with StaticalPrismCALCmd.exe mcp-server-stdio. Not needed. Built again by every server the agent starts.

Use HTTP while you work in Prism; use stdio when the agent works on its own.

Connect an agent

Start a server, add an entry for it to your agent's MCP configuration, and tell the agent to use it. The MCP Server page writes the entry for you.

Start the server in the workspace window

Use this to serve the object store you have open in Prism.

  1. Open the object store in Prism for C/AL: a file store, a folder store or a mirror.
  2. In the workspace window, select MCP Server in the navigation rail.
  3. Check the Port card. It shows Port is available for the port Prism will use, 47821 unless you chose another. If it shows Port is in use, select Find free.
  4. Select Start.

The Status card shows Running, and the endpoint shows http://localhost:47821. Select Heartbeat to check that the server answers. The server runs until you select Stop or close the workspace window.

Start the server from the command line

Use this to serve an object store over HTTP without a Prism window, for example on a build machine.

  1. Open a command prompt.
  2. Run StaticalPrismCALCmd.exe mcp-server-http with the path of the object text file or folder. Add --encoding and the filter options when your Prism settings use them, so the agent sees the same objects as your workspace window.
  3. Leave the window open while agents use the server; press Ctrl+C to stop it.
StaticalPrismCALCmd.exe mcp-server-http "C:\NAV\Cronus" --port 47821
StaticalPrismCALCmd.exe mcp-server-http "C:\NAV\Cronus" --port-search 47821..47920 --encoding 850 --file-include-filter "*.txt"
The HTTP server running in a command prompt.

The server prints “MCP server is running on http://localhost:47821” and builds the symbol index. The Command Line section of the MCP Server page shows this command with the path of the open store filled in. All options are on the Command line page.

Connect GitHub Copilot in Visual Studio Code

Use this to give GitHub Copilot in Visual Studio Code (agent mode) the Prism tools. For HTTP, start the server first in the workspace window or from the command line.

  1. On the MCP Server page, select Show mcp.json….
  2. In Client, select Visual Studio Code (Copilot).
  3. Select HTTP (this window), or stdio (own process) to let Visual Studio Code start its own server.
  4. If the folder Visual Studio Code has open has no .vscode/mcp.json, select Copy whole file and save it as .vscode/mcp.json at the root of that folder. Otherwise select Copy entry and paste it inside the file's "servers" block, separated from the entry before it by a comma.
  5. Start a new chat in agent mode and ask a question that names a C/AL object.
The mcp.json popup with Visual Studio Code (Copilot) and HTTP selected
1 2 3 4
The mcp.json popup for Visual Studio Code, over HTTP.
#NameDescription
1ClientVisual Studio Code (Copilot).
2Paste intoThe file the entry belongs in: .vscode/mcp.json.
3HTTP (this window)The transport of the entry.
4Copy entry and Copy whole fileCopy the entry alone, or the whole file. See The mcp.json popup.
{
  "servers": {
    "prism-cronus-3f9a1c": {
      "type": "http",
      "url": "http://localhost:47821"
    }
  }
}

The entry for stdio holds a command instead of a URL:

{
  "servers": {
    "prism-cronus-3f9a1c": {
      "type": "stdio",
      "command": "StaticalPrismCALCmd.exe",
      "args": [
        "mcp-server-stdio",
        "C:\\NAV\\Cronus"
      ]
    }
  }
}

When Visual Studio Code has a .code-workspace file open, add the "servers" block under "settings" › "mcp" in that file instead: a .vscode/mcp.json beside it is never read. GitHub Copilot does not read MCP resources; it uses the tools list_resources and read_resource instead.

Connect Claude Code

Use this to give Claude Code, in the command line or in the Code tab of the desktop app, the Prism tools. For HTTP, start the server first.

  1. On the MCP Server page, select Show mcp.json….
  2. In Client, select Claude Code.
  3. Select HTTP (this window) or stdio (own process).
  4. If the repository has no .mcp.json at its root, select Copy whole file and save it there. Otherwise select Copy entry and paste it inside the file's "mcpServers" block, separated from the entry before it by a comma.
  5. Start a new Claude Code session in the repository and ask a question that names a C/AL object.
{
  "mcpServers": {
    "prism-cronus-3f9a1c": {
      "type": "http",
      "url": "http://localhost:47821"
    }
  }
}
{
  "mcpServers": {
    "prism-cronus-3f9a1c": {
      "type": "stdio",
      "command": "StaticalPrismCALCmd.exe",
      "args": [
        "mcp-server-stdio",
        "C:\\NAV\\Cronus"
      ]
    }
  }
}

Connect another MCP client

Use this for any other agent that reads an MCP configuration file.

  1. On the MCP Server page, select Show mcp.json….
  2. In Client, select Other / generic, then the transport.
  3. Copy the entry into your client's MCP configuration, per project if your client has such a file.
  4. Start a new session and ask a question that names a C/AL object.

The generic entry has the shape of the Claude Code one, with an explicit "type" on both transports. If the server does not appear, your client probably uses another key than "mcpServers"; its documentation names it.

Tell your agent to use Prism

Use this when the agent searches the object text files instead of calling Prism. A text match misses usages through record variables, Rec and WITH blocks, and matches same-named fields and procedures of other objects; Prism's index does not.

  1. Save the skill below as prism-for-cal/SKILL.md in the agent's skills folder (see the table).
  2. If your agent does not read skills, add the short text after the table to the file it reads at the start of every session, such as AGENTS.md.
  3. Start a new session.
---
name: prism-for-cal
description: Use for any question about this repository's C/AL code (Dynamics NAV objects) — where a field, procedure or table is used or written, what a procedure calls, which objects depend on an object, whether an edited object still parses. Load this before searching text or reading the exported object files; text search gives wrong answers for C/AL.
---

# Prism for C/AL

This repository's C/AL objects are indexed by the **Prism for C/AL** MCP server,
which resolves each reference to the declaration it binds to — through record
variables, `Rec` and `WITH` blocks, where a text match misses usages and matches
same-named fields and procedures of other objects.

If your client defers the server's tools, load them with one tool search, then
start from `find_symbols` and pass the `prismPathUri` it returns to the other
tools unchanged. After the objects are exported or edited again, call
`reload_workspace` before you trust the answers.
AgentSkills folder
Claude Code .claude/skills/ in the repository, or ~/.claude/skills/ for every repository.
GitHub Copilot, Codex, Cursor and Zed .agents/skills/ in the repository, or ~/.agents/skills/ for every repository.
This repository's C/AL objects are indexed by the Prism for C/AL MCP server. For any question
about where C/AL code is used or written, what a procedure calls or which objects depend on an
object, use its tools before text search; text search gives wrong answers for C/AL.

Ask your first questions

These prompts show what the index answers that a text search cannot, each with the tools the agent calls. Use names from your own objects.

  • Where is field Credit Limit (LCY) of table Customer written?

    1. find_symbols
    2. find_references

    Only the lines that assign the field, VALIDATE among them, grouped by object and trigger.

  • Which objects use codeunit Sales-Post?

    1. find_symbols
    2. find_object_dependencies

    The objects that depend on it, each with how: a variable, a parameter, a property or a call by name or number.

  • What does PostCustomerEntry in codeunit Sales-Post call, three levels down? Show me the code of anything that posts to the G/L.

    1. find_symbols
    2. find_callees
    3. get_source_code
  • How does page Sales Order end up depending on codeunit Gen. Jnl.-Post Line?

    1. find_symbols
    2. find_dependency_paths

    The routes between the two objects, shortest first, each hop with the kind of dependency.

  • I changed this object. Is it still valid C/AL before I import it?

    1. check_object_source

    A syntax check of the object text, with the line and column of the first error.

  • Which of our objects from 50000 to 99999 subscribe to events?

    1. find_symbols
Claude Code with Prism connected, asked where Credit Limit (LCY) is written.
GitHub Copilot in Visual Studio Code, asked which objects use Sales-Post.

The declarations an agent names are Prism Paths. Paste one into Universal Search to open the declaration in Prism and check the answer yourself.

MCP Server page

The MCP Server page of a Workspace window runs an HTTP server for the object store that window has open, and writes the configuration your agent needs.

Opening it

  • Select MCP Server in the workspace window's navigation rail, below Reports. Its tooltip reads AI assistant connectivity.
The MCP Server page of a workspace window with the server running on port 47821
1 2 3 4 5 6 7 8 9
The MCP Server page with the server running.
#NameDescription
1MCP ServerThe page in the navigation rail.
2TransportsExplains the two transports. The controls on the page manage only the HTTP server; a stdio server runs in a process your agent starts.
3StatusStopped, Starting…, Running or Stopping….
4PortThe port the server listens on. While the server runs, it reads Port 47821 — in use by this server; while it is stopped, it holds the port controls. See Port, status and heartbeat.
5MCP client configShow mcp.json… opens the mcp.json popup.
6EndpointThe server's address, such as http://localhost:47821. Open in browser opens its information page while the server runs; Copy to clipboard copies the address.
7HTTP serverThe controls of the in-process HTTP server. While it is stopped, Start starts it. Stdio servers run in their own process and are not affected.
8StopStops the HTTP server and disconnects its clients. Calls in progress get up to five seconds to finish.
9HeartbeatConnects an MCP client to the server, completes the handshake and lists the tools, to prove that the server answers.

Port, status and heartbeat

The Port card of the MCP Server page with the server stopped and the port available
1 2 3 4
The Port card while the server is stopped.
#Control or textEffect
1Port statusChecking port…, Port is available, Port is in use, Port is in use by a program and its process ID when Prism can tell, or Port status unknown.
2Re-check port availability now (refresh button)Checks the port at once. Prism also checks it every 10 seconds.
3Port boxThe port, 1 to 65535. Prism remembers the last port you used; the first time it is 47821. Only while the server is stopped.
4Find freeTakes the first free port from 47821 to 47920. Available while the server is stopped and the port is not known to be free. If none is free, a banner says No free port found in the default range 47821..47920.

The page also shows, when they apply:

  • Error banner: why the server failed, Failed to start: or Failed to stop: and the reason.
  • Heartbeat result: OK — the server's name and version, the number of tools and the round-trip time; or Failed after a number of milliseconds and the reason. It fades after a while.

Open in browser opens http://localhost:47821/info, a page with the server's version and endpoint, the number of tools and resources, the MCP Inspector command and a sample configuration. The MCP endpoint itself is the root address, which answers MCP clients only.

The mcp.json popup

Show mcp.json… opens a popup with the configuration entry for this object store, ready to paste into your agent's MCP configuration file.

The mcp.json popup with Claude Code and stdio selected
1 2 3 4 5 6
The mcp.json popup for Claude Code, over stdio.
#NameDescription
1ClientVisual Studio Code (Copilot), Claude Code or Other / generic. The client decides the file and the key the entry goes under. The line below names the file to paste into, after Paste into, and its scope.
2HTTP (this window)An entry that connects to the server this page runs. The server must be started, and the entry changes when you change the port.
3stdio (own process)An entry that makes the agent start a server of its own, which works with Prism closed. It holds the absolute path of the object store, so it does not work on another machine unchanged.
4ConfigurationThe entry as a whole file, coloured, with a note below on what it depends on.
5Copy entryCopies the server's entry alone, for a file that already lists servers. Paste it inside the existing block, separated from its neighbours by a comma.
6Copy whole fileCopies the whole file, for a client that has no file yet. It replaces what a file holds.
ClientFileKey
Visual Studio Code (Copilot).vscode/mcp.json at the root of the folder Visual Studio Code has open"servers"
Claude Code.mcp.json at the root of the repository"mcpServers"
Other / genericYour client's mcp.json, per project if it has one"mcpServers"

Every entry has "type" "http" or "stdio". Prism names the entry prism-, the store's name and six characters derived from its full path, such as prism-cronus-3f9a1c, so entries for two object stores never overwrite each other. With no object store open, the path in a stdio entry is the placeholder <workspace path>; replace it before use.

Capabilities, command lines and tools

Below the controls, the page lists what the server offers and how to run it without the window.

The Capabilities and Command Line sections of the MCP Server page, with the MCP Inspector command lines
1 2 3
Capabilities and Command Line, with the MCP Inspector command lines.
#NameDescription
1CapabilitiesCards for the HTTP transport and the stdio transport, and the number of Tools and Resources the server offers.
2Command LineThe PrismCmd card, the Opened workspace path, and the two command lines that start the same server without Prism, over HTTP and over stdio, each with Copy to clipboard.
3MCP InspectorTwo command lines that open the MCP Inspector, a browser tool for trying the server's tools and resources by hand: one for this page's HTTP server, one that starts a stdio server. They need Node.js.

Below them, the Tools section lists the tools by category; see Tools. The Resources section at the end lists each resource with its title, URI and type. The MCP Inspector remembers the last server address it used; if it shows another address than the page, correct it before you connect.

Prism Paths

Every tool names an object or declaration by its Prism Path, the same path Copy Prism Path to Clipboard copies in Prism. A path starts with prism:, then the object type and the object's name, then one step per member. These paths name a codeunit, a procedure in it, and the OnValidate trigger of a field:

prism:Codeunit/Sales-Post
prism:Codeunit/Sales-Post/Procedure/PostCustomerEntry
prism:Table/Customer/Field/City/Trigger/OnValidate

The object step carries the object's name, not its number. Spaces and other special characters are escaped as in a web address, such as %20 for a space. Paths also reach the controls, actions and data items of pages, forms and reports, report sections, XMLport elements and request forms.

An agent never writes a path itself: it finds the object or member with find_symbols, takes the prismPathUri from the answer and passes it on unchanged. The server's instructions tell it so.

Tools

The Tools section of the MCP Server page, with the Symbol Search category expanded
1 2 3
The Tools section of the MCP Server page, with Symbol Search expanded.
#NameDescription
1CategoryA tool category with its number of tools, such as Symbol Search (5). Select it to expand or collapse it.
2ToolThe tool's name, as the agent calls it, such as find_symbols.
3DescriptionThe description the agent reads to decide when to call the tool.

The server has 11 tools in five categories. Every tool is listed in every session, whatever your license; six of them need a licensed feature, as each tool's entry says.

CategoryTools
Symbol Searchfind_symbols, find_references, find_callees, find_object_dependencies, find_dependency_paths
Diagnosticscheck_object_source
Source Codeget_source_code
Workspacereload_workspace, list_resources, read_resource
Feedbacksubmit_mcp_feedback

These rules hold for every tool:

  • Request. The parameters go inside a request object: { "request": { ... } }. Parameters sent without it are rejected.
  • Patterns. A pattern parameter is an RE2 regular expression, case-insensitive and not anchored: Cust matches anywhere in a name, ^Sales at its start and ^Customer$ the whole name. Escape metacharacters to match them literally, as in Sales-Post \(Yes/No\). Backreferences and lookarounds are not supported.
  • Paging. A tool with a paging parameter takes limit (1 to 500) and offset (0 or more, default 0). The default limit is 200 unless the tool says otherwise. The answer's pagination holds totalCount, limit, offset and hasMore.
  • Answer. Lines and columns in answers count from 0. A tool answers a failure as described under Errors, and a success in this shape:
    {
      "result": {
        "kind": "success",
        "data": { ... }
      }
    }
{
  "request": {
    "queryRegex": "^Credit Limit \\(LCY\\)$",
    "kinds": [ "field" ],
    "objectsRegex": "^Customer$"
  }
}

Parameters that take fixed values list them below. The resource mcp://tools/input-enumerations lists them all with their meaning.

find_symbols

Searches objects and their members (procedures, triggers, fields, keys and more) by name, and returns each with its Prism Path, sorted by object ID. Use it first: the other tools take the paths it returns. Needs no license.

ParameterTypeRequiredDefaultDescription
queryRegexstringYesPattern matched against object names and member names. .* matches every name.
kindsarray of stringsNoAll kindsOnly symbols of these kinds: any, codeunit, table, form, page, report, menusuite, query, xmlport, dataport, procedure, event, trigger, field, key, property. event is a C/AL EVENT handler of a DotNet or Automation variable, not an event publisher.
objectsRegexstringNoAll objectsOnly symbols inside objects whose name matches this pattern, such as ^Sales-Post$.
objectIdRangesarray of objectsNoAll IDsOnly objects whose ID falls in one of these inclusive ranges, each { "start": N, "end": M }. Leave out start or end for an open range.
versionListobjectNoNo filter Only objects whose Version List has tags that match: tag (exactly this tag, case-sensitive, such as NAVW17.10), product (the three-letter product prefix, such as NAV), country (an ISO country code, W1 or UK; unknown codes are rejected) and shape (base, otherProduct, addOn, customer or unknown). Each criterion needs one matching tag; different criteria may match different tags.
eventRolestringNoNo filterOnly procedures in this event role: Publisher ([Integration] or [Business]), Subscriber ([EventSubscriber]) or Either.
includeSignaturesbooleanNofalseAdds the signature of procedures and events: parameters and return value as declared.
includeVersionListbooleanNofalseAdds the object's Version List to object results.
levelstringNofullmetrics returns the count alone, in pagination.totalCount; full returns the page.
pagingobjectNoLimit 75See paging.

All filters apply together. Returns pagination, results and, when the query may not do what it reads like, a hint. Each result has prismPathUri, objectKind, objectName, objectId, kind and name; a field also has dataType and, for a FlowField or FlowFilter, fieldClass; a publisher or subscriber has eventRoles. Fails with invalid_pattern, invalid_request or missing_required_property.

find_references

Finds every place an object or declaration is used. For a declaration it returns the code lines, grouped by object and by the declaration that hosts each reference; for an object it returns the objects that reference it. An [EventSubscriber] binding counts as a reference to its publisher. Needs the Find References license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
prismPathUristringYesThe Prism Path of the object or declaration.
assignmentTargetOnlybooleanNofalseOnly the places where the declaration is written: :=, +=, VALIDATE, EVALUATE, CLEAR, MODIFYALL, TRANSFERFIELDS. Needs a declaration path.
includeTransferFieldsbooleanNofalseIncludes references inside TRANSFERFIELDS calls.
includeMessageParametersbooleanNofalseIncludes references passed to ERROR, MESSAGE or CONFIRM.
includeClearRecordbooleanNofalseIncludes references inside CLEAR calls.
includeLineTextbooleanNotruefalse leaves out the text of each code line, to keep the answer small.
scopeFilterarray of stringsNoAll kindsOnly references whose hosting declaration is of these kinds, such as ["trigger"] or ["procedure"]. Takes the symbol kinds that find_symbols returns. Needs a declaration path.
lineTextRegexstringNoNo filterOnly references whose code line matches this pattern, such as Cust\.GET\(. Needs a declaration path.
outputFormatstringNotreetree: objects, declarations and code lines. summary: one row per referencing object with its reference count.
pagingobjectNoLimit 200 in tree, 100 in summarytree pages references, so an object can span two pages; summary pages objects.

Returns pagination and objects: each with objectKind, objectName, objectId, prismPathUri and its declarations, each with its code lines (lineNo, lineText). A reference can carry codeUsageFlags: AssignmentTarget, FieldTransfer, MessageParameter, Clear, RecordTemporary or ParameterByReference. unfilteredCount appears when the filters removed references, skippedObjects lists objects that could not be searched, and a declaration summary adds referenceCount. Fails with invalid_path, cal_object_not_found, invalid_pattern or invalid_request, the last for a filter that needs a declaration path.

find_callees

Lists the procedures and triggers that a procedure or trigger calls, and optionally the system functions, grouped by the object called. It can follow the calls further down. Needs the Find References license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
prismPathUristringYesThe Prism Path of a procedure or trigger.
maxDepthintegerNo1Call levels to follow, 1 to 20; 1 is the direct calls only.
includeSystemFunctionsbooleanNofalseIncludes calls to system functions such as MESSAGE, ERROR and INSERT.
includeUnresolvedbooleanNofalseAdds the names that did not resolve, such as a misspelt call or an object missing from the store.
includeLineTextbooleanNotruefalse leaves out the text of each code line.
outputFormatstringNotreetree: objects, declarations and code lines. summary: objects with their call counts on the page.
pagingobjectNoLimit 200See paging.

Returns pagination and objects; with includeUnresolved, unresolved (name, lineNo, lineText, reason; at most 500); with a maxDepth above 1, reachability (reachableCount, maxDepthReached, cycleCount). Fails with invalid_path, cal_object_not_found or invalid_request.

find_object_dependencies

Lists the objects an object depends on, or the objects that depend on it, each with the kinds of dependency. Objects missing from the store appear with their ID and an empty name. Needs the Find References license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
prismPathUristringYesThe Prism Path of an object, with no member step.
directionstringNooutout: what the object depends on. in: what depends on it.
dependencyTypesarray of stringsNoAll kindsOnly these dependency kinds.
maxDepthintegerNo1Levels to follow, 1 to 20; 1 is the direct dependencies only.
pagingobjectNoLimit 200Pages objects. See paging.

Returns pagination, direction and dependencies, each with objectKind, objectName, objectId, prismPathUri and dependencyTypes; with a maxDepth above 1, also reachability, and the kinds add up along all paths. Fails with invalid_path, cal_object_not_found or invalid_request.

Dependency kindMeaning
VariableA local or global variable of the object's type.
ParameterA procedure or trigger parameter of the object's type.
CodeObjectNameCode that names the object, such as CODEUNIT::"My Codeunit".
CodeObjectIdCode that uses the object's ID, such as REPORT.RUN(42).
EventSubscriptionAn event subscription to a database trigger of a table.
ObjectReferencePropertyA property that names another object, such as TableNo, SourceTable or PagePartID. Reported beside the finer kinds below.
TableRelationPropertyA TableRelation property.
CalcFormulaPropertyA CalcFormula property of a FlowField or FlowFilter.
PermissionPropertyA Permissions or AccessByPermission property.
SourceTablePropertyThe SourceTable of a page or form.
ReportDataItemA report data item's table.
QueryDataItemA query data item's table.
XmlPortTableElementAn XMLport table element's source table.
PagePartA page or form shown as a part of another (PagePartID, SubFormID).

find_dependency_paths

Finds the dependency paths between two objects, shortest first, each hop with its kinds of dependency. No object repeats within a path. Use find_object_dependencies for everything an object reaches, and this tool for the route between two. Needs the Find References license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
fromstringYesThe Prism Path of the start object.
tostringYesThe Prism Path of the end object. Must differ from from.
directionstringNooutout: paths along which from depends on to. in: paths along which to depends on from.
dependencyTypesarray of stringsNoAll kindsOnly hops with one of these dependency kinds.
maxDepthintegerNo5The most hops in a path, 1 to 20.
maxPathsintegerNo10The most paths to return, 1 to 50.
pagingobjectNoLimit 200Pages the paths found. See paging.

Returns pagination, paths (each a list of edges with from, to and dependencyTypes) and truncated, which is true when maxPaths or a search limit cut the result; a hint then says what to change. Fails with invalid_path, cal_object_not_found or invalid_request.

check_object_source

Parses the C/AL text of one object and reports whether it is valid. It checks syntax only, not references or types, and stops at the first error. Lines may end in CRLF or LF. Needs the Source Code license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
sourcestringYesThe text of a single object, starting with OBJECT. Check the objects of a multi-object file one at a time.

Returns valid, the objectDescriptor read from the OBJECT line (objectKind, objectId, objectName) and at most one entry in diagnostics: message, line, column, absoluteOffset, the rejected token and about 200 characters of text near it. Fails with missing_required_property. For the objects of the store that failed to parse, read mcp://workspace/diagnostics/summary.

get_source_code

Returns the C/AL text of a whole object, or of one declaration such as a field or a procedure, exactly as it is in the object store. Needs the Source Code license feature: not available without a license.

ParameterTypeRequiredDefaultDescription
prismPathUristringYesThe Prism Path of the object or declaration.
startFromLineintegerNo0The first line to return, counted from the start of the declaration. A value past the end returns no text and a hint with the line count.
maxLinesintegerNo400The most lines to return, 1 or more.
includeParentContextbooleanNofalseFor a declaration, adds parentContext: the Prism Path, kind, name and ID of its object.

Returns source, the object's objectKind, objectName and objectId, for a declaration its memberKind and memberName, the declaration's range within the object, and totalLines, returnedLines, startFromLine, truncated and hasMore. When hasMore is true, call again with startFromLine moved on by returnedLines. Fails with invalid_path, cal_object_not_found, declaration_not_found or source_file_not_found.

reload_workspace

Reads the object store from disk again and rebuilds the symbol index, after objects were exported or edited. The previous index keeps answering while the reload runs. It reloads with the encoding and filters the server started with. Needs no license.

ParameterTypeRequiredDefaultDescription
reasonstringNoNoneWhy the agent reloads, written to the server log. The whole request is optional.

Returns objectCount, builtInObjectCount (Prism's built-in system tables, such as 2000000026 Integer, which no object file declares), objectCountByKind and diff, the change in object counts since the last load. A reload still running after 20 seconds answers workspace_reloading and carries on; the same call made meanwhile waits for that reload. Clients that ask for progress get progress notifications.

list_resources

Lists the server's resources, for agents that cannot read MCP resources themselves, such as GitHub Copilot in Visual Studio Code. It takes no parameters. Needs no license.

Returns count and resources, each with uri, name, title, description and mimeType.

read_resource

Reads one resource, for the same agents. Needs no license.

ParameterTypeRequiredDefaultDescription
uristringYesThe resource's URI, such as mcp://workspace/diagnostics/detail/errors.

Returns uri, mimeType and content, the resource as text. Fails with missing_required_property or invalid_request.

submit_mcp_feedback

Sends feedback on a tool, a resource or the server to Statical over the internet: what the agent tried, how it went and what would help. Needs no license.

ParameterTypeRequiredDefaultDescription
subjectKindstringYestool, resource or server.
subjectNamestringYesThe tool's or resource's name; for server, any short label.
outcomestringYessucceeded, succeeded_with_correction, failed_prism (Prism returned wrong or missing data), failed_agent or did_not_try.
intentstringYesOne sentence on what the user wanted.
commentstringYesWhat worked, what did not, what would help.
ratingintegerNoNone1 to 5.
toolDescriptionClaritystringNoNoneclear, ambiguous, missing or na.
host, model, calPlatformVersionstringNoNoneThe agent's application, its model and the NAV platform version.
extensionTargetstringNoNoneThe kind of project: Internal, OnPrem or Other.
contextstringNoNoneThe call's arguments, answer or error text.
emailstringNoNoneAn address Statical may reply to.

Returns a thank-you message. A server accepts one submission per 15 seconds, 10 per hour and 50 per session, and refuses a repeat of a recent submission. Fails with missing_required_property or invalid_request, for a limit reached, an unknown subject name or a submission that is too large.

Resources

Resources are reference documents an agent reads on demand. All of them can be read with any license. Agents that cannot read resources use list_resources and read_resource.

URITitleTypeHolds
mcp://server/informationServer InformationJSONThe company, product, version, commit and build time, and the time of the snapshot being served, to confirm which build answers.
mcp://workspace/infoWorkspace InformationJSONThe object store's path, the object counts, the time of the snapshot being served, and in loadSettings the host (desktop or cli), encoding and folder store filters it was loaded with.
mcp://workspace/symbols/statusWorkspace Symbols StatusJSONWhether the symbol index is active, loading or failed, and whether a reload runs or failed.
mcp://license/statusLicense InformationJSONThe tools and resources that need no license, and each licensed feature with whether it is enabled and the tools it covers.
mcp://tools/input-enumerationsTool Input EnumerationsMarkdownEvery value the tools' fixed-value parameters accept, with its meaning.
mcp://workspace/diagnostics/summaryWorkspace DiagnosticsJSONThe number of objects that failed to parse, the object counts and the number of unresolved references by name.
mcp://workspace/diagnostics/detail/{section}Workspace Diagnostics DetailJSONerrors: the objects that failed to parse, and why. unresolved-references: the names that did not resolve to an object in the store. Another section name returns the valid ones.

While the symbol index is loading or has failed, the workspace and diagnostics resources answer with its status and the URI to check instead of their content.

Errors

A failed call answers with "kind": "failure", an error sentence, an errorDetails text with a hint, a code, and permanent, which says whether retrying the same call can succeed. A failure that clears on its own adds retryAfterSeconds, and pollUri names the resource that reports the condition. Agents act on code, never on the wording.

{
  "result": {
    "kind": "failure",
    "error": "The requested capability is not enabled by the current license.",
    "errorDetails": "Tool 'get_source_code' requires the 'Source Code' feature, which is not enabled by the current license. Read 'mcp://license/status' for the full license status. | Hint: The tool exists but the current license does not enable the feature it belongs to. Read the 'mcp://license/status' resource to see which features are enabled and what each gates; do not retry the call without a license change.",
    "code": "feature_not_licensed",
    "permanent": true,
    "pollUri": "mcp://license/status"
  }
}
CodeMeaningWhat to do
workspace_reloadingThe symbol index is still loading (permanent false), or failed to load (true).Retry after retryAfterSeconds; after a failed load, call reload_workspace.
feature_not_licensedThe license does not enable the tool's feature.Install a license that does; see License and readiness.
invalid_pathThe Prism Path is malformed.Take the path from find_symbols.
cal_object_not_foundThe path names no object in the store.Search for the object with find_symbols.
declaration_not_foundThe path names no declaration the object has.Search for the member with find_symbols.
source_file_not_foundThe object's file is no longer in the store.Call reload_workspace.
missing_required_propertyA required parameter is missing.Send it.
invalid_requestThe request breaks the tool's rules, such as a value out of range or parameters outside request.Correct the request.
invalid_patternA pattern is not a valid RE2 regular expression.Correct the pattern.
unknown_errorAn unexpected failure.Read errorDetails; report it with submit_mcp_feedback if it persists.

License and readiness

The server runs with or without a license and lists every tool. Six tools need a licensed feature, which a license and a trial license enable:

License featureTools
Find Referencesfind_references, find_callees, find_object_dependencies, find_dependency_paths
Source Codeget_source_code, check_object_source
Nonefind_symbols, reload_workspace, list_resources, read_resource, submit_mcp_feedback, and every resource

A call to a tool whose feature is not enabled fails with feature_not_licensed. The server reads the license at every call, so a key you install in Prism or with license install takes effect without a restart. See Activate license window.

A server starts answering at once and builds the symbol index in the background. Meanwhile reload_workspace, list_resources, read_resource and submit_mcp_feedback answer at once. Any other call waits up to 20 seconds for the index and then runs, or fails with workspace_reloading and a time to retry after. If the index failed to load, a call fails at once; reload_workspace tries again.

Troubleshooting

The agent cannot connect

Symptom: the agent lists no Prism tools, or reports that it cannot reach the server.

Cause: an HTTP entry points at a server that is not running, or at another port.

  1. Check that the MCP Server page shows Running, or that the command line printed MCP server is running on.
  2. Compare the port in the entry's "url" with the server's port, and correct the entry.
  3. Start a new agent session.

The server answers 403 Forbidden

Symptom: the server answers 403 with “Forbidden. The Prism MCP server answers loopback requests only; reach it as localhost, 127.0.0.1 or [::1].”

Cause: the request used another host name, or came from a web page. The server answers this machine only.

  1. Use http://localhost:<port>, 127.0.0.1 or [::1] in the entry.

The port is in use

Symptom: the Port card shows Port is in use, or the command line prints Port 47821 is unavailable and exits with -30.

Cause: another program, or another Prism window, listens on the port.

  1. On the MCP Server page, select Find free; on the command line, add --port-search 47821..47920 or another --port.
  2. Start the server and update the port in your agent's entry.

Calls fail with workspace_reloading

Symptom: calls fail with workspace_reloading.

Cause: the symbol index is still building after the 20-second wait, which happens on a large store, or it failed to load.

  1. If permanent is false, let the agent retry after retryAfterSeconds.
  2. If permanent is true, read mcp://workspace/symbols/status for the reason, fix it, and call reload_workspace.

Calls fail with feature_not_licensed

Symptom: calls fail with feature_not_licensed.

Cause: the tool needs the Find References or Source Code feature, which your license does not enable.

  1. Install a license key or start a trial; see Activate license window.
  2. Call the tool again; the server needs no restart.

The agent sees other objects than Prism

Symptom: the agent finds other objects, or garbled names, compared with your workspace window.

Cause: a command-line server reads the objects with its own encoding and filters, not with Prism's settings.

  1. Compare loadSettings in mcp://workspace/info of the two servers.
  2. Restart the command-line server with --encoding and the filter options set as on the Settings page.

A stdio server does not start

Symptom: the agent hangs or reports a failed server, and its log shows “ERROR: mcp-server-http serves MCP over HTTP and cannot be launched as a stdio MCP server.”

Cause: the stdio entry runs mcp-server-http, which exits with -31 when an agent starts it.

  1. Change mcp-server-http to mcp-server-stdio in the entry's "args", or copy the entry again from the mcp.json popup.

The agent searches the text files

Symptom: the agent greps the object text files instead of calling the Prism tools.

Cause: nothing tells the agent that Prism answers C/AL questions better.

  1. Add the skill from Tell your agent to use Prism.
  2. Name a Prism tool in your first prompts, such as "use find_references".

For anything else, select Help › Feedback… in Prism, or let the agent call submit_mcp_feedback.