Skip to main content
Glama
orjahren

Nettskjema MCP Server

by orjahren

get_answer_attachment

Download a Nettskjema answer attachment to disk as a streamed file and get its absolute path; omit output_path to create a temp file.

Instructions

Download an answer attachment to a file, written to disk.

The attachment is streamed to disk and never inlined: a multi-megabyte audio recording as base64 is useless to a model. The returned path is absolute and tilde-expanded. An existing file at the output path is silently overwritten, and its mode is preserved. A new file (whether from output_path or a temp file) is created with mode 0600 (readable only by the current user).

When output_path is omitted, a temporary file is created in the system temp directory with a suffix derived from the response's media type. The temporary file persists after this call returns and is left on disk for the caller to use or delete.

Input Schema

NameRequiredDescriptionDefault
output_pathNoDestination file path. When omitted, a temporary file is created in the system temp directory. The path may contain ~ for the home directory and may be relative (it will be resolved to an absolute path).
answer_attachment_idYesThe attachment's numeric ID.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it discloses silent overwrite of existing files, mode preservation, 0600 permissions on new files, absolute/tilde-expanded return paths, and that temp files persist after the call. These are exactly the destructive and side-effect details an agent needs before invoking.

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?

Front-loaded with the core action in the first sentence, then organized into coherent paragraphs on path handling, overwrite/permission semantics, and temp-file behavior. Slight redundancy ('written to disk' restated as 'streamed to disk') keeps it from a perfect score.

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?

An output schema exists so return values need not be described, and the remaining gaps an agent would care about (where the file lands, what happens to existing files, permissions, temp-file lifetime) are all covered. Nothing needed to call it correctly is missing.

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 100%, so the baseline is 3, and the description adds meaning beyond the schema by explaining why output_path is omitted (temp file in system temp dir with a suffix derived from the response media type) and by reinforcing the absolute-path return. It stops short of documenting invalid-id or failure behavior for the required ID.

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?

States a specific verb and resource ('Download an answer attachment to a file'), and the emphasis on streaming to disk rather than inlining distinguishes it from sibling read tools like get_image or get_submission_pdf that return different artifacts. An agent can identify the operation without opening the schema.

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

Usage Guidelines3/5

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

Usage is implied by the mechanics described (omit output_path for a temp file, supply it to control the destination), but there is no explicit when-to-use guidance and no routing to alternatives such as get_attachment_transcription or get_submission_pdf. The context is inferable but never stated.

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