Skip to main content
Glama

Validate a regulatory action (dry-run)

validate_action
Read-onlyIdempotent

Validate a proposed Norwegian regulatory action (VAT or employer report) without any upstream side effect, catching missing delegations and payload-shape errors before live submission.

Instructions

Run the Apier dry-run validator against a proposed regulatory action without producing ANY upstream side effect — no Maskinporten call, no Altinn / Skatteetaten / NAV submission. Use this BEFORE the live execute path to catch missing delegations and payload-shape errors at zero upstream cost. The verdict carries five prerequisite check slots (each pass / fail / skipped), the overall valid boolean, the DRY_RUN_DISCLAIMER (a pass is NOT a guarantee of upstream success), and the preview echo would_be_payload + preview_notice. Inputs match the /v1/actions/execute body: { org_number (9 digits, MOD-11), action_type (mva_melding | a_melding), period, payload }. The nested payload object is intentional - it mirrors the upstream government payload schema for the action, so it is not flattened. Failure modes: SCOPE_INSUFFICIENT (needs read:actions), VALIDATION_FAILED; the validator never throws. To actually file a (sandbox) VAT return, use submit_vat_return instead. No sandbox mirror — under a sandbox bearer call submit_vat_return instead. Docs: https://www.apier.no/docs/guides/mva-filing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYesReporting period. mva_melding: `YYYY-T1..T6` (bimonthly), `YYYY-A` (annual), or `YYYY-MM` (monthly). a_melding: `YYYY-MM`.
payloadYesThe upstream-shaped JSON payload for the action; the route's per-action discriminated Zod owns shape validation. Capped at 64 KiB UTF-8 here.
org_numberYes9-digit Norwegian organisasjonsnummer (passing MOD-11) the proposed action targets.
action_typeYesThe regulatory action to dry-run — `mva_melding` (VAT return) or `a_melding` (employer report).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
_metaNo
resultYesThe structured dry-run verdict: the overall `valid` boolean, the five check slots (each pass/fail/skipped with a reason), the DRY_RUN_DISCLAIMER, and the preview echo `would_be_payload` + `preview_notice`. No upstream side effect.
metadataYes
justificationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/destructive false, but the description goes further: it enumerates concrete side-effect exclusions (no Maskinporten, no Altinn/Skatteetaten/NAV submission) and discloses behavioral traits beyond annotations: 'the validator never throws', the verdict's five prerequisite slots, the DRY_RUN_DISCLAIMER, and the failure modes. This is exactly the kind of behavioral context that makes an agent safe with the tool.

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

Conciseness4/5

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

The description is long but information-dense and front-loads the most critical fact: zero upstream side effects. It earns most sentences. It loses a point for redundancy: 'No sandbox mirror' and 'under a sandbox bearer call submit_vat_return instead' convey the same instruction twice, which could be tightened.

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?

Even with an output schema present, the description explains the verdict shape, the disclaimer, preview echo, failure modes, required scope, and alternative submission path. It also includes a docs link. For a complex dry-run validator tool, this is thoroughly complete.

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?

The schema already documents all four parameters at 100% coverage, so the baseline is 3. The description adds extra meaning by noting the inputs mirror the /v1/actions/execute body and explaining that the nested payload is intentional and mirrors the upstream government schema, which helps an agent construct correct payloads without flattening them.

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 opening sentence states a specific verb and resource: 'Run the Apier dry-run validator against a proposed regulatory action.' It also explicitly contrasts itself with the live execute path and names submit_vat_return as the sibling for actual filing, so an agent can tell it apart without opening another schema.

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 says 'Use this BEFORE the live execute path' and warns that under a sandbox bearer one should 'call submit_vat_return instead.' It also surfaces the required read:actions scope via SCOPE_INSUFFICIENT, giving clear when-to-use and when-not-to-use criteria.

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