Skip to main content
Glama

Company filing history (Altinn) + Apier audit trail

get_company_filing_history
Read-onlyIdempotent

Reconcile a Norwegian organisation's Altinn 3 filing history against filings submitted via Apier, returning each filing paired with its Apier audit record to verify which were filed through you.

Instructions

Reconcile a Norwegian company's Altinn 3 filing history against the filings YOUR consumer submitted through Apier. Given a 9-digit organisasjonsnummer it returns the org's Altinn filing instances (Mva-melding, A-melding, Skattemelding, …), each paired with its Apier audit record where one exists (filed_via_apier + apier_record). Cursor-paginated via { cursor } (pass back pagination.next_cursor) + { limit } (1–100, default 20); legacy { offset } still accepted (deprecated); no filings → 200 with an empty list, never a 404. MOCK-GATED until the altinn:instances.read Maskinporten scope is approved. Failure modes: SCOPE_INSUFFICIENT (needs read:altinn), AUTH_NO_DELEGATION (live mode), VALIDATION_FAILED. For upcoming deadlines rather than past filings, use get_company_deadlines instead. No API key? Bearer apier_sandbox_test_ (fresh suffix) serves synthetic fixtures; org numbers: GET /api/v1/sandbox/fixtures. Cost: 50 øre (NOK 0.50) per call, prepaid (prices: the get_pricing tool or GET /api/v1/pricing; a shortfall returns INSUFFICIENT_CREDITS with top_up_url). Docs: https://www.apier.no/docs/guides/audit-inspection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoPage size 1–100 (route default 20).
cursorNoOpaque continuation token from the previous page's `pagination.next_cursor` - the canonical way to page.
offsetNoZero-based offset (deprecated - use `cursor` instead).
org_numberYes9-digit Norwegian organisasjonsnummer (Brønnøysund ID); MOD-11-checked up-front — a failing value is rejected as VALIDATION_FAILED, so correct the number rather than retrying it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
_metaNo
resultYesThe paired filing history: `data[]` Altinn instances (form code, title, agency, submitted_at, status, instance id) each with `filed_via_apier` + `apier_record` when Apier submitted it, plus a `pagination` block. No filings → empty `data[]`, not an error.
metadataYes
justificationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint/idempotentHint annotations, it discloses pagination mechanics (cursor vs legacy offset, deprecation), the empty-200-never-404 contract, mock gating, specific error codes, cost and prepaid billing, and sandbox fixtures. 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?

The text is long but dense: every clause carries a distinct fact (purpose, pagination, mock gating, failure modes, cost, sandbox, alternative, docs). It front-loads the purpose and routes to the sibling at the end. 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?

For a read-only audit-reconciliation tool with 4 params and an output schema, the description covers prerequisites, error handling, pagination, pricing, and sandbox testing. An agent has everything needed to call it correctly.

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

Parameters5/5

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

Schema coverage is 100%, but the description still enriches org_number with the MOD-11 pre-check and 'don't retry' guidance, explains the cursor's continuation semantics, and flags the offset deprecation — all beyond the schema text.

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

Purpose5/5

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

The description opens with a precise verb ('Reconcile') and a concrete resource (Altinn filing history against Apier audit trail), and immediately distinguishes it from the deadline tool. It states exactly what the tool returns and how it pairs filings with audit records.

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

Usage Guidelines5/5

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

It explicitly names the alternative tool for deadlines ('get_company_deadlines'), specifies the precondition (Maskinporten scope for live mode, sandbox fallback), and documents failure modes and cost, telling the agent exactly when and how to use it.

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