bcquality/custom/knowledge/mcp/bc-mcp-tools-must-be-preloaded.md
Michael Dieringer dd5637b1db Custom-laget bestaar nu begge CI-checks: 72 validator-fejl -> 0
Normalisering af alle 39 custom knowledge-filer til READ-kontraktens
skema (validate_frontmatter.py + Test-KnowledgeIndex.ps1 begge groenne):

- R01/R02: 28 filer manglede frontmatter eller brugte aeldre skemaer
  (title/category/severity/rule-id m.fl.) - alle har nu praecis de 6
  kraevede noegler; keywords haandskrevet pr. fil da de driver
  worklist-selektionen i INDEX/knowledge-index
- R09: manglende Description-sektion - regel-agtige foersteoverskrifter
  (Core Rule/Rule/Regel/Core Principle) omdoebt, eller sektion indsat
  efter titlen hvor intro-tekst fandtes
- R10: fenced code blocks konverteret til 4-space indrykkede blokke
  i alle filer (indhold uaendret)
- R11: 4 filer over 100 linjer fortaettet redaktionelt uden semantisk
  tab (ai-eval-scores 143->100, git-lifecycle 121->97,
  permission-sets 113->99, test-feature-scenario-tags 105->91)
- R05: AL0197->al0197, add_repo->add-repo; keyword-lister trimmet
  til maks 10

Ingen regler er fjernet eller aendret i betydning - kun form.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 23:47:31 +02:00

1.8 KiB

bc-version domain keywords technologies countries application-area
all
mcp
mcp
tools
preload
session-start
bc
al
w1
all

--- rule: bc-mcp-tools-must-be-preloaded title: BC MCP tool schemas must be pre-loaded at session start category: mcp severity: required

BC MCP tool schemas must be pre-loaded at session start

Description

When the bc-mcp.agent.md agent is invoked, the very first action must be to load the BC MCP tool schemas via ToolSearch — before producing any user-visible output.

ToolSearch query: select:mcp__businesscentral__bc_actions_search,mcp__businesscentral__bc_actions_invoke,mcp__businesscentral__bc_actions_describe

This call must complete before the agent responds to the user.

Why

Claude Code loads MCP tool schemas lazily ("deferred"). If the first ToolSearch call happens mid-task — after the user has already received a response — the user experiences unexpected latency at the moment they expect an action, not setup.

Pre-loading at invocation time moves the cost to a predictable point (agent startup) and eliminates mid-task delays entirely.

What counts as a violation

  • The agent issues any user-visible text or takes any BC action before calling ToolSearch to load the three mcp__businesscentral__bc_actions_* schemas.
  • The agent assumes the schemas are already loaded from a previous session without verifying.

Correct pattern

# bc-mcp.agent.md session start

1. ToolSearch: select:mcp__businesscentral__bc_actions_search,
               mcp__businesscentral__bc_actions_invoke,
               mcp__businesscentral__bc_actions_describe
2. [proceed with user request]

Scope

Applies to every invocation of bc-mcp.agent.md in every CURABIS project that uses the Business Central MCP bridge (bc-mcp-bridge.js).