Skip to main content
Glama

Find codes

firmafakta_find_codes
Read-only

Find the codes a segment filters on (municipality, county, SNI industry, legal form and the other code tables describe lists in code_tables) by text or code prefix, best match first, at most 25 (more says how many were left out); an industry's section and groups come before its codes, and the trademark tables are searched only when named in table. Use it instead of guessing codes; no match gives an empty matches list. Free. It searches code tables only, not companies: for a company use firmafakta_company or firmafakta_lookup.

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": {
      "query": "<query>"
    },
    "name": "firmafakta_find_codes"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYeswords in a code's name or the start of a code, e.g. bygg, Kungälv or 433
tableNoone code table from describe's code_tables; omitted searches all

Output Schema

NameRequiredDescriptionDefault
moreNohow many more matches were left out: narrow the query or name a table
usageNo
matchesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / matches / items / properties / code
      Added value: +{
      +  "title": "code"
      +}
    • removedOutput schema / properties / matches / items / properties / kod
      Removed value: -{
      -  "title": "kod"
      -}
  2. Changed38 schema fields changed
    • addedOutput schema / properties / matches / items / properties / kod / title
      Added value: +"kod"
    • removedOutput schema / properties / matches / items / properties / kod / type
      Removed value: -"string"
    • addedOutput schema / properties / matches / items / properties / level / title
      Added value: +"level"
    • removedOutput schema / properties / matches / items / properties / level / type
      Removed value: -"string"
    • addedOutput schema / properties / matches / items / properties / table / title
      Added value: +"table"
    • removedOutput schema / properties / matches / items / properties / table / type
      Removed value: -"string"
    • addedOutput schema / properties / matches / items / properties / text / title
      Added value: +"text"
    • removedOutput schema / properties / matches / items / properties / text / type
      Removed value: -"string"
    • removedOutput schema / properties / matches / items / required
      Removed value: -[
      -  "table",
      -  "kod",
      -  "text"
      -]
    • addedOutput schema / properties / matches / items / title
      Added value: +"matches"
    • removedOutput schema / properties / matches / items / type
      Removed value: -"object"
    • addedOutput schema / properties / matches / title
      Added value: +"matches"
    • removedOutput schema / properties / matches / type
      Removed value: -[
      -  "null",
      -  "array"
      -]
    • removedOutput schema / properties / more / 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: -[
      -  "matches",
      -  "usage"
      -]
  3. Changed1 schema field changed
    • addedOutput schema / properties / more
      Added value: +{
      +  "description": "how many more matches were left out: narrow the query or name a table",
      +  "type": "integer"
      +}
  4. Changed1 schema field changed
    • changedInput schema / properties / query / description
      Previous value: -"text or code to look for, e.g. bygg or 433"New value: +"words in a code's name or the start of a code, e.g. bygg, Kungälv or 433"
  5. Changed5 schema fields changed
    • removedOutput schema / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / matches / 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
  6. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, destructiveHint=false, openWorldHint=false), so the bar is lower, yet the description still adds real behavior: a hard cap of 25 results, a 'more' indicator counting what was left out, best-match-first ordering, and industry section/groups preceding codes. It does not explain cost-unit or rate behavior beyond the word 'Free', and it doesn't reconcile why idempotentHint is false, which keeps it just short of a 5.

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?

No filler sentences, but the whole definition is one sprawling sentence stitched with parentheses and semicolons, with the result-limit and ordering details buried mid-clause. Content density is good; front-loading of structure is weak, and splitting into two or three sentences would cost nothing.

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 needn't be explained, and the description still covers the things an agent must know: result cap, leftover indicator, ordering, empty-result semantics, and that trademarks are searchable only when named. Complete for a two-parameter, read-only lookup tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (query syntax, table selection). The description mostly restates those hints ('by text or code prefix', 'the code tables describe lists in code_tables') and adds only one genuinely new constraint – trademark tables require explicit naming – so baseline 3 applies.

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?

Specific verb+resource: 'Find the codes a segment filters on', with the code-table domains enumerated (municipality, county, SNI industry, legal form). It explicitly scopes itself against siblings by stating 'It searches code tables only, not companies: for a company use firmafakta_company or firmafakta_lookup', so an agent can distinguish it without opening any 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?

Gives a direct when-to-use rule ('Use it instead of guessing codes'), a when-not rule ('not companies', naming the two alternative tools), and a table-selection rule ('the trademark tables are searched only when named in table'). Edge-case behavior for no match is also stated.

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.