Skip to main content
Glama
glachana

bc-source-mcp

by glachana

Get the source of an AL object

bc_get_object
Read-onlyIdempotent

Retrieve the AL source code of a specific Business Central object (table, page, codeunit, etc.) by branch, type, and name. Optionally fetch a line range or skip source to get only metadata.

Instructions

Returns the AL source of a specific object (table, page, codeunit, report, enum, query, xmlport, or any extension). Identifies the object by branch + type + name (case-insensitive on type, exact on name). Triggers indexing on first use of a branch. Use line_start/line_end to fetch only a slice (1-indexed, inclusive) — useful for large objects (~100k lines). Use include_source=false to skip the source and get only metadata (size, total_lines).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYesBranch name, e.g. "w1-26"
typeYesAL object type, e.g. "table", "page", "codeunit"
nameYesObject name (without quotes), e.g. "Customer", "Sales Header"
line_startNoOptional 1-indexed start line (inclusive). Default 1.
line_endNoOptional 1-indexed end line (inclusive). Default: last line.
include_sourceNoIf false, omits the source string and returns only metadata. Default true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchYes
typeYes
idYes
nameYes
appYes
pathYes
ext_targetYes
sourceYes
size_bytesYes
total_linesYes
returned_linesYes
truncatedYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnly and idempotent hints. Description adds that indexing is triggered on first use of a branch and specifies case-insensitivity on type. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, each serving a purpose: main function, identification details, indexing side effect, optional parameter usage. Front-loaded with purpose, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters (3 required) and an output schema, the description covers object identification, optional slicing, metadata-only mode, and indexing. Output schema exists so return values need not be detailed. Complete for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%. Description adds meaningful details: line_start/line_end are 1-indexed and inclusive, branch example 'w1-26', object types enumerated, name examples given, and include_source explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns AL source for specific object types and identifies objects by branch, type, and name. It is specific but does not explicitly differentiate from sibling tools like bc_get_procedure or bc_get_event_publishers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on using optional parameters (line_start/line_end for slicing, include_source for metadata-only). Mentions indexing trigger on first branch use. Lacks explicit when-not-to-use guidance but is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/glachana/bc-source-mcp'

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