Files
accounted/extensions/general/mcp-server/resources
Jakob Wennberg 267ed6c1bb feat(mcp): expose the konteringspaket catalogue as a resource (#1395)
An agent proposing a booking currently invents the account numbers, and a
plausible guess (6071 instead of 6072, or the full cost instead of the 80%
deductible share) produces a verifikat that posts and is wrong. This turns that
into naming a reviewed template.

Read from packs/ rather than the database on purpose: legal_note has no column
in booking_template_library, so the database copy cannot answer "when does this
template apply", and that note is the one field an agent cannot derive from
account numbers.

Carries the amount maths explicitly (vat lines from vat_rate, everything else
from ratio) with an instruction not to fudge an amount to force a balance, plus
notes that entity_type is binding, that a company may hold templates beyond this
list, and that posting goes through the journal-entry tools so period locks and
the balance check still apply.

A load failure returns an explicit error rather than an empty list: an agent
shown 12 of 26 templates concludes the other 14 do not exist and hand-rolls
accounts for them.

Verified the packs are actually reachable at runtime before relying on this: a
production build traces all 26 YAML files into the serverless function, so the
loader is not a local-only convenience.

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 22:17:27 +02:00
..
2026-05-04 11:12:29 +02:00