Skip to main content
Glama

Lås räkenskapsår

lock_fiscal_year
Idempotent

Lås (stäng) hela räkenskapsåret när årsbokslutets poster är klara (booked/skipped). Låset låser alla årets månader och gör att deklarationen (INK2 och årsredovisning, NE-bilaga eller INK4) blir klar att lämna i appen (samma som knappen 'Lås perioden' i Bokslutsposter). Höjer fel med vad som återstår om något steg inte är klart. Före räkenskapsårets slut avvisas låsningen; visa användaren close_warnings ur get_year_end_checklist och sätt before_year_end=true bara om hen godtar att året stängs i förväg. Finns det annat att se över (moms, obetalda fakturor, avskrivningar som inte är bokförda) avvisas låsningen med en lista; visa den för användaren och sätt confirm=true bara om hen vill stänga ändå. Skiljer sig bokföringen från skatteberäkningen (t.ex. aktuell skatt som inte är bokförd i ett år som deklarerats av en tidigare byrå) avvisas låsningen med 409 och en förklaring; confirm=true stänger ändå och sparar skillnaden på året (syns i get_year_end_checklist som closed_with_differences tills året låses upp). Scope book. Argument: orgnr, year; valfritt before_year_end, confirm (gäller båda).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "orgnr": "<orgnr>",
      "year": "<year>"
    },
    "name": "lock_fiscal_year"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearYes
orgnrYesBolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies.
confirmNo
before_year_endNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / confirm
      Added value: +{
      +  "default": false,
      +  "title": "Confirm",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / before_year_end
      Added value: +{
      +  "default": false,
      +  "title": "Before Year End",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / orgnr / description
      Added value: +"Bolagets organisationsnummer, 10 siffror med eller utan bindestreck, t.ex. 559900-1004. Hämta med list_companies."
  4. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare that this is a non-read-only, idempotent, non-destructive write, so the description carries most of the burden and does so: it discloses the cascade to all months of the year, validation failures that raise errors listing remaining steps, a 409 on tax/bookkeeping discrepancy, and that confirm=true persists the difference as closed_with_differences until the year is unlocked. The only gap is that it does not say what the success response contains, though no output schema exists to cover that.

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 front-loaded with purpose and effect before the exception branches, and nearly every clause carries decision-relevant content (three distinct rejection paths and their required flags). It is a dense single paragraph, however, and the closing 'Argument: orgnr, year; valfritt before_year_end, confirm (gäller båda)' is terse and mildly ambiguous after the earlier prose.

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 state-changing tool with no output schema and sparse parameter documentation, the description covers prerequisites, side effects, all known error conditions with their exact flag-based workarounds, and the transient closed_with_differences state. An agent has everything it needs to call this correctly and to explain the outcome to the user.

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 only 25% (orgnr alone is documented), so the description must compensate — and it does for the two flags, explaining precisely that before_year_end accepts early closing of the year and confirm accepts closing despite warnings or discrepancies, including that they apply to both rejection paths. The year parameter is only named in the terse argument list, with no format or source guidance, which keeps it below a 5.

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 specific verb and resource ('Lås (stäng) hela räkenskapsåret') plus a precondition ('när årsbokslutets poster är klara'). It goes on to spell out the concrete effect — locking all months of the year and making the declaration (INK2/NE-bilaga/INK4) ready to submit — so an agent can distinguish it from unlock_fiscal_year, remove_fiscal_year and the checklist tools without opening a 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 gives explicit when-to-use (year-end entries booked/skipped), three named when-not conditions (before year end, outstanding checks like VAT/unpaid invoices/missing depreciations, bookkeeping vs. tax discrepancy), and the correct fallback for each: read close_warnings via get_year_end_checklist, then set before_year_end=true or confirm=true only with the user's consent. The decision path is fully specified rather than implied.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.