Skip to main content
Glama
orjahren

Nettskjema MCP Server

by orjahren

export_form_csv

Export a form's submission data as CSV. Save to a file or return text, with truncation for large exports.

Instructions

Export a form's submission data as CSV.

The spec's summary describes the response as a CSV text file with semicolon (;) as the delimiter. When output_path is provided, the file is written to disk (mode 0600 for a new file) and the result reports the path, byte count and media type. When output_path is omitted, the text is returned as JSON with a size signal and truncation flag. The result is capped at max_chars (default 1,000,000) to bound context size: check the truncated field to see if the full export was cut.

Input Schema

NameRequiredDescriptionDefault
form_idYesThe form's numeric ID.
max_charsNoMaximum characters to return when output_path is omitted. Defaults to this MCP server's configured limit (1,000,000). When the cap is reached, the text is cut at the last complete newline before the limit and truncated is set to true. The caller may raise this limit arbitrarily by passing a larger value. Ignored when output_path is provided.
output_pathNoDestination file path. When provided, the CSV is written to disk and path/bytes/mediaType are returned instead of the text. The path may contain ~ for the home directory and may be relative (it will be resolved to an absolute path). An existing file is overwritten and its mode is preserved; a new file is created with mode 0600.
optimize_for_large_dataNoRequest optimization for large datasets.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so admirably: it discloses that output_path writes to disk with mode 0600 for new files (overwriting existing files while preserving mode), that omitting it returns JSON, that results are capped at max_chars with truncation at the last complete newline, and that a truncated flag signals cutting. These are exactly the mutation/side-effect facts an agent needs.

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 one-line purpose, then two coherent paragraphs covering the two output modes and the truncation cap. Slightly verbose in echoing schema details (mode 0600, ~ resolution) but every sentence is on-topic and earned.

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, yet the description still clarifies return-shape behavior (path/bytes/mediaType vs JSON with size signal) and the truncation contract. For a 4-parameter export tool with no annotations, nothing material an agent needs 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, but the description adds genuinely non-schema information such as the semicolon delimiter of the CSV and the interaction between max_chars and output_path. The restating of defaults and path resolution overlaps the schema, keeping this from a 5.

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

Purpose4/5

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

States a specific verb, resource and output format: 'Export a form's submission data as CSV.' This is clearly distinguishable from read tools like get_form_answers. However, it never differentiates from the close sibling export_form_excel, which an agent must choose between, so it falls short of a 5.

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?

The description explains the behavioral consequence of providing vs omitting output_path, which implicitly guides usage, but it never states when to pick this tool over export_form_excel or other export/read alternatives. Usage is implied rather than prescribed.

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