Skip to main content
Glama

Fetch segment rows

firmafakta_fetch
Read-only

Fetch a segment's rows: a page of them in the answer, or with format a file of them. A segment is an expression in describe's segment language, which has examples. Pass segment and per, which is required with segment (workplace: a row per workplace; company: a row per company, its main workplace; email: a row per e-mail address of each company, every address where a company row gives the first three), and optionally limit, fields, sort; or only next from the previous page to continue. Without fields each row has describe's short_fields; name others from describe's result_fields in fields, or use firmafakta_lookup for everything on one company. Each row costs credits; a nightly update between pages may shift rows. Without limit a page is 10 rows, costing 10 credits; at most 1000. With format (csv or xlsx) the answer is a link to a file of the rows instead of the rows: use it for more rows than you would read, or a list the user keeps; without fields the file has every field the plan reaches. A file holds at most 5000 rows, and without limit what the credits buy; a larger segment comes in parts, the next part a file again with next. The link works for one download within 24 hours: give it to the user, and open it yourself only to work on the file, since opening it uses it up. random draws limit rows at random from the segment, in rows or in a file, as one page.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "firmafakta_fetch"
  }
}

Input Schema

NameRequiredDescriptionDefault
perNorequired with segment: workplace (a row per workplace), company (a row per company, its main workplace) or email (a row per e-mail address of each company: the address, its kind and sources after org number and name, then any fields); a page continued with next keeps its per
nextNothe next value of the previous page, alone, to continue
sortNoa field from describe's sort_fields, optionally followed by asc or desc
limitNorows in this page, at one credit a row; describe's limits give the default and the maximum
fieldsNoreturned fields to include, from describe's result_fields; omitted gives its short_fields
formatNocsv or xlsx: answer with a link to a file of the segment's rows instead of rows, a part of at most describe's file_max rows; next from its answer gives the next part as a file
randomNodraw limit rows at random from the segment instead of in order; not with sort or next
segmentNothe segment expression; omit when passing next

Output Schema

NameRequiredDescriptionDefault
fileNo
nextNo
rowsNo
totalNo
usageNo
lockedNo
readbackNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / per / description
      Previous value: -"required with segment: workplace (a row per workplace) or company (a row per company, its main workplace); a page continued with next keeps its per"New value: +"required with segment: workplace (a row per workplace), company (a row per company, its main workplace) or email (a row per e-mail address of each company: the address, its kind and sources after org number and name, then any fields); a page continued with next keeps its per"
    • changedInput schema / properties / per / enum
      Previous value: -[
      -  "workplace",
      -  "company"
      -]New value: +[
      +  "workplace",
      +  "company",
      +  "email"
      +]
  2. Changed3 schema fields changed
    • addedInput schema / properties / format
      Added value: +{
      +  "description": "csv or xlsx: answer with a link to a file of the segment's rows instead of rows, a part of at most describe's file_max rows; next from its answer gives the next part as a file",
      +  "type": "string"
      +}
    • addedInput schema / properties / random
      Added value: +{
      +  "description": "draw limit rows at random from the segment instead of in order; not with sort or next",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / file
      Added value: +{
      +  "properties": {
      +    "expires_at": {
      +      "description": "when the link stops working if not used"
      +    },
      +    "format": {
      +      "description": "csv or xlsx"
      +    },
      +    "name": {
      +      "description": "the file's name"
      +    },
      +    "rows": {
      +      "description": "rows in the file; total is the segment's size"
      +    },
      +    "url": {
      +      "description": "the link to the file; it works for one download"
      +    }
      +  },
      +  "title": "file"
      +}
  3. Changed48 schema fields changed
    • addedOutput schema / properties / locked / items / properties / fields / items / title
      Added value: +"fields"
    • removedOutput schema / properties / locked / items / properties / fields / items / type
      Removed value: -"string"
    • addedOutput schema / properties / locked / items / properties / fields / title
      Added value: +"fields"
    • removedOutput schema / properties / locked / items / properties / fields / type
      Removed value: -[
      -  "null",
      -  "array"
      -]
    • addedOutput schema / properties / locked / items / properties / message / title
      Added value: +"message"
    • removedOutput schema / properties / locked / items / properties / message / type
      Removed value: -"string"
    • addedOutput schema / properties / locked / items / properties / plan / title
      Added value: +"plan"
    • removedOutput schema / properties / locked / items / properties / plan / type
      Removed value: -"string"
    • removedOutput schema / properties / locked / items / required
      Removed value: -[
      -  "plan",
      -  "fields",
      -  "message"
      -]
    • addedOutput schema / properties / locked / items / title
      Added value: +"locked"
    • removedOutput schema / properties / locked / items / type
      Removed value: -"object"
    • addedOutput schema / properties / locked / title
      Added value: +"locked"
    • removedOutput schema / properties / locked / type
      Removed value: -[
      -  "null",
      -  "array"
      -]
    • addedOutput schema / properties / next / title
      Added value: +"next"
    • removedOutput schema / properties / next / type
      Removed value: -"string"
    • addedOutput schema / properties / readback / title
      Added value: +"readback"
    • removedOutput schema / properties / readback / type
      Removed value: -"string"
    • removedOutput schema / properties / rows / items / additionalProperties
      Removed value: -true
    • addedOutput schema / properties / rows / items / title
      Added value: +"rows"
    • removedOutput schema / properties / rows / items / type
      Removed value: -"object"
    • addedOutput schema / properties / rows / title
      Added value: +"rows"
    • removedOutput schema / properties / rows / type
      Removed value: -[
      -  "null",
      -  "array"
      -]
    • addedOutput schema / properties / total / title
      Added value: +"total"
    • removedOutput schema / properties / total / type
      Removed value: -"integer"
    • removedOutput schema / properties / usage / properties / credits_charged / maximum
      Removed value: -2147483647
    • removedOutput schema / properties / usage / properties / credits_charged / minimum
      Removed value: --2147483648
    • addedOutput schema / properties / usage / properties / credits_charged / title
      Added value: +"credits_charged"
    • removedOutput schema / properties / usage / properties / credits_charged / type
      Removed value: -"integer"
    • removedOutput schema / properties / usage / properties / credits_left / maximum
      Removed value: -2147483647
    • removedOutput schema / properties / usage / properties / credits_left / minimum
      Removed value: --2147483648
    • addedOutput schema / properties / usage / properties / credits_left / title
      Added value: +"credits_left"
    • removedOutput schema / properties / usage / properties / credits_left / type
      Removed value: -[
      -  "null",
      -  "integer"
      -]
    • removedOutput schema / properties / usage / properties / offer
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / usage / properties / plan / title
      Added value: +"plan"
    • removedOutput schema / properties / usage / properties / plan / type
      Removed value: -"string"
    • addedOutput schema / properties / usage / properties / refills_on / title
      Added value: +"refills_on"
    • removedOutput schema / properties / usage / properties / refills_on / type
      Removed value: -"string"
    • addedOutput schema / properties / usage / properties / throttled / properties / plan / title
      Added value: +"plan"
    • removedOutput schema / properties / usage / properties / throttled / properties / plan / type
      Removed value: -"string"
    • addedOutput schema / properties / usage / properties / throttled / properties / waited_ms / title
      Added value: +"waited_ms"
    • removedOutput schema / properties / usage / properties / throttled / properties / waited_ms / type
      Removed value: -"integer"
    • removedOutput schema / properties / usage / properties / throttled / required
      Removed value: -[
      -  "waited_ms",
      -  "plan"
      -]
    • addedOutput schema / properties / usage / properties / throttled / title
      Added value: +"throttled"
    • removedOutput schema / properties / usage / properties / throttled / type
      Removed value: -[
      -  "null",
      -  "object"
      -]
    • removedOutput schema / properties / usage / required
      Removed value: -[
      -  "plan",
      -  "credits_charged"
      -]
    • addedOutput schema / properties / usage / title
      Added value: +"usage"
    • removedOutput schema / properties / usage / type
      Removed value: -"object"
    • removedOutput schema / required
      Removed value: -[
      -  "rows",
      -  "total",
      -  "readback",
      -  "usage"
      -]
  4. Changed1 schema field changed
    • changedOutput schema / properties / rows / items / additionalProperties
      Previous value: -{
      -  "type": [
      -    "null",
      -    "string"
      -  ]
      -}New value: +true
  5. Changed1 schema field changed
    • changedInput schema / properties / limit / description
      Previous value: -"rows in this page; see describe for the default and the maximum"New value: +"rows in this page, at one credit a row; describe's limits give the default and the maximum"
  6. Changed5 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / locked / items / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / usage / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / usage / properties / offer
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / usage / properties / throttled / additionalProperties
      Removed value: -false
  7. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the readOnly/non-destructive annotations it discloses credit cost per row, default and maximum page sizes, the 5000-row file cap, part-wise continuation via next, and the critical 24-hour single-download link that is consumed by opening it. What it does not cover is what happens on credit exhaustion or whether a failed fetch charges credits, which matters for a metered read.

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

Conciseness3/5

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

It is one long run-on paragraph that front-loads the core action well but then chains many clauses with semicolons, and some parenthetical text ("a row per workplace; company: a row per company, its main workplace...") duplicates the per parameter's schema description verbatim. Information density is high, but structure and some redundancy cost it.

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 an 8-parameter, credit-metered, paginated, file-producing tool with an output schema, the description covers defaults, caps, continuation, randomness, and link lifetime. An agent has enough to call it correctly without consulting other tools first.

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 prose adds real coupling semantics: per is required whenever segment is present, per is preserved across next continuation, and fields defaults to describe's short_fields with others named from result_fields. That routing to firmafakta_describe's vocabularies is meaning the schema alone does not supply.

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?

"Fetch a segment's rows: a page of them in the answer, or with format a file of them" gives a specific verb, resource, and the two output modes in one sentence. It is clearly distinct from siblings like firmafakta_lookup and firmafakta_describe, which it references for field and segment-syntax details.

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 states when to use format ("more rows than you would read, or a list the user keeps"), when to pass only next ("to continue"), when to name fields versus reaching for firmafakta_lookup, and the constraint that random is incompatible with sort or next. Alternatives and exclusions are both present.

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.