Skip to main content
Glama

Ändra en rad i en lista

update_list_item
Destructive

Ändrar, lägger till eller tar bort en enda rad i en lista i steg 3 till 6, utan att röra de andra raderna.

Använd i stället för update_fields när en periodiseringsfond, en undertecknare eller en annan rad i en lista ska ändras: update_fields ersätter hela listan. Raden hittas med match; finns ingen rad, eller flera, ändras ingenting och svaret listar raderna. Ändringen görs med samma uppdatering som formuläret och samma kontroller som update_fields (datum, roller, tecken).

Returnerar action (updated, created eller removed), item (raden efter ändringen), rows (antal rader i listan efteråt), warnings och snapshot.

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": {
      "draft_id": "<draft_id>",
      "section": "<section>",
      "list": "<list>",
      "match": "<match>"
    },
    "name": "update_list_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
listYesListans fältnamn som read_draft visar det, t.ex. "periodiseringsfonder" eller "signatories". Nästlade listor med punkt, t.ex. "inputs.namn".
matchYesFält som identifierar raden, t.ex. {"ar": "2019"} för en periodiseringsfond eller {"id": "..."} (eller {"firstName": "Anna", "lastName": "Svensson"}) för en undertecknare. index är radens plats i listan (från 0) och skiljer åt rader som annars är lika, t.ex. {"ar": "2019", "index": 4}; felet när flera rader matchar listar dem med index.
createNotrue lägger till en ny rad (match + values) om ingen rad matchar.
removeNotrue tar bort raden som matchar. Bekräfta med användaren först.
valuesNoFälten som ändras på raden, t.ex. {"aterfort": 100}. Övriga fält och rader behålls.
sectionYesDelen där listan finns, och steget guiden står på: tax = steg 3 (periodiseringsfonder), management_report = steg 4, notes = steg 5, signature = steg 6 (signatories).
draft_idYesUtkastets id (draft_id), t.ex. från list_drafts. Utkastet måste tillhöra det anslutna kontot.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is covered. The description adds real context beyond that: failed matches change nothing and the response lists the candidate rows, validation mirrors the form and update_fields (dates, roles, characters), and the returned fields action/item/rows/warnings/snapshot are named. It does not discuss reversibility or permissions, 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.

Conciseness4/5

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

The text is front-loaded with the core action and the sibling contrast, and each subsequent sentence adds distinct information (match failure, validation parity, return fields). It is somewhat dense and long, but no sentence is redundant.

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 7-parameter mutation tool with a nested match object and no output schema, the description supplies the failure semantics and enumerates the return fields (action, item, rows, warnings, snapshot). Combined with annotations that already flag destructiveness, nothing essential for a correct call is missing.

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 match, index disambiguation, list, section, create, remove, and values in detail. The description reinforces the matching concept and the create/remove behavior but adds little syntax or format detail beyond what the schema provides, so the 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?

The description states a specific verb set (change, add, or remove), a precise resource (a single row in a list), and a scope (steps 3–6, without touching other rows). It also explicitly contrasts itself with update_fields, so an agent can distinguish it from the sibling without opening either 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 an explicit routing rule: use this instead of update_fields when a single list row (periodiseringsfond, signatory, etc.) is to be changed, because update_fields replaces the whole list. It also documents what happens when the match finds zero or multiple rows, so the agent knows the failure condition before calling.

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.