Skip to main content
Glama

update_context

DestructiveIdempotent

Updates an existing context item in the team's reference library: rename it, replace its body, re-pull a tracked web page, or move it between collections and projects.

Project and collection placement are independent: an item can sit in a project AND a collection at once. Moving an item into a collection changes collection_id only.

  • collection_id is REQUIRED (the key must be present; omitting it is a 400). Pass the current id to keep the item in its collection, a different id to move it, or null (or 0) to move it to the loose reference library.

  • project_id: omit it to leave the item's project exactly as it is. Pass a project id to move it to that project. Pass null ONLY when the user asked to take the item out of its project.

Body and name (patch-style; omit to leave alone):

  • name: new name.

  • content: new markdown body; triggers re-embedding.

  • import_url: a public URL fetched once and converted to markdown server-side, replacing the body with a one-off snapshot. Use it instead of content for a large new body. content and import_url are mutually exclusive.

refresh_webpage: true re-pulls a tracked web page from its stored URL (the app's refresh button). Valid only for items added with add_context connected_webpage_url (content_type "webpage"); requires admin or editor role. On that branch name / content / import_url are ignored, collection_id is not required, and the item's project and collection stay exactly as they were.

Find ids with list_context_items, list_context_collections, get_project or get_relevant_context. Present link_url exactly as returned.

Input semantics:

  • context_item_id: REQUIRED. The UUID of the context item to update.

  • refresh_webpage: OPTIONAL boolean. On any item other than a "webpage" item it returns a clear error.

  • name: OPTIONAL. Ignored when refresh_webpage is true.

  • content: OPTIONAL. Ignored when refresh_webpage is true.

  • import_url: OPTIONAL. Uses AI main-content extraction (the same engine as connected_webpage_url: it isolates the primary page/article body and drops nav and boilerplate). It is a one-off snapshot; to keep a web-page item in sync with its URL, use refresh_webpage instead. Ignored when refresh_webpage is true.

  • collection_id: REQUIRED (its value may be null).

  • project_id: OPTIONAL. Omit to leave the project unchanged; a project id moves the item there; null detaches it (only when the user asked).

If the context item has a linked editor document, its title, content and word_count are auto-synced and a realtime update is broadcast to open editors.

Links: copy link_url character for character. Never retype, shorten, or rebuild a link or the IDs inside it.

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": {
      "context_item_id": "<context_item_id>",
      "collection_id": "<collection_id>"
    },
    "name": "update_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoNew display name for the item. Omit it to leave the current name untouched — this is not a rename-to-blank; only a value you actually pass takes effect. Changing the name re-embeds the item so retrieval matches the new wording. Ignored when refresh_webpage is true.
contentNoReplacement markdown body — the complete new text, not a patch or an append. Omit it to leave the existing body alone; passing it re-embeds the item for retrieval and queues a re-check of anything that relied on the old text. Mutually exclusive with import_url (sending both → 400), and ignored when refresh_webpage is true.
import_urlNoA publicly reachable URL that is fetched and converted to markdown, replacing the whole body with a fresh one-off snapshot — use it instead of content when the new body is large. Unlike add_context, this fetch happens inline, so the call takes longer and returns a 400 if extraction fails; it is a snapshot only, so to keep a tracked page in sync use refresh_webpage instead. Mutually exclusive with content (both → 400), and ignored when refresh_webpage is true.
project_idNoThe project this item sits in. Omit the key to leave the item's project unchanged: project and collection placement are independent, so moving an item into a collection does not touch this. Pass a project ID to move the item to that project (same team only). Pass null only when the user asked to take the item out of its project. Not read at all when refresh_webpage is true, so a refresh never moves the item.
collection_idYesThe collection this item should sit in AFTER the update. You must send this key on every call — omitting it is a 400 ("Missing param: collection_id") — because it fully replaces the current value rather than merging. Pass the item's current collection ID to keep it where it is, a different ID to move it, or null (or 0) to move it back to the loose reference library; read the current value with get_context_item first if you don't know it. Not read at all when refresh_webpage is true, so it is not required on that branch.
context_item_idYesUUID of the reference item to update — required, and the only way to target the item. Get it from list_context_items, get_project, get_relevant_context, or the id returned by add_context. An unknown id returns not-found, and an item belonging to another team is rejected.
refresh_webpageNoSet true to re-pull a tracked page's body from the URL stored when it was added — the same action as the refresh button in the app. It only works on items added via add_context connected_webpage_url; on anything else it returns an error telling you to use content or import_url instead. When true, name, content, and import_url are all ignored, and so are collection_id and project_id — this branch does not read them, so collection_id is not required here and the item stays in whatever project and collection it was already in. Defaults to false.

Output Schema

NameRequiredDescriptionDefault
idNoContext item ID
nameNoUpdated context item name
contentNoUpdated reference content
link_urlNoURL to view this context item in the Marcora web app.
project_idNoProject this item is associated with (null if none)
updated_atNoUnix timestamp of last update
word_countNoWord count of updated content
content_typeNomanual or webpage
collection_idNoCollection this item belongs to (null if none)
content_introNoTruncated content intro used in listings
relevancy_processed_statusNoTargeting-dimension processing state, for reference-library items only. Omitted entirely for items that belong to a project or a context collection. This does NOT indicate whether the item is embedded or retrievable — every context item is embedded for semantic search at ingestion regardless of this value. Reset to 'unprocessed' whenever name or content changes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes well beyond them: it discloses that content/name changes trigger re-embedding, that import_url replaces the body with a one-off snapshot (destruction made concrete), that a linked editor document is auto-synced and realtime updates are broadcast, and that fetch happens inline so latency and 400-on-extraction-failure are possible. Nothing here contradicts the annotations.

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?

The top section is well front-loaded and bulleted, but the trailing 'Input semantics' block re-narrates facts already stated above and already present in the schema descriptions (collection_id REQUIRED is stated three times; the refresh-ignores-fields rule four times). Substantial duplication costs it against an otherwise tight structure.

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 an output schema and rich annotations, the description covers everything an agent needs: required-key behavior, patch-style omission semantics, the special refresh branch and its exemptions, role requirements, error conditions, and side effects on linked documents.

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; the description still adds meaning on top by explaining the collection_id replacement-instead-of-merge rule (passing the current id to keep it, 0 or null for the loose library), the three-way project_id semantics (omit / id / null-only-when-asked), and the mutual exclusivity of content and import_url. It largely restates the schema's own parameter texts in the 'Input semantics' block, which limits the added value.

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 opening sentence names a specific verb (updates) and resource (an existing context item in the team's reference library) and enumerates the four distinct operations: rename, replace body, re-pull a tracked page, move between collections/projects. It is clearly distinguishable from add_context (creation) and get_context_item (reads), and even flags that refresh_webpage is the app's refresh button.

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?

Explicit routing is given for the hard choice an agent faces: use import_url instead of content for a large new body, and use refresh_webpage rather than import_url to keep a tracked page in sync. It also names the discovery tools (list_context_items, list_context_collections, get_project, get_relevant_context) for obtaining ids and states the admin/editor-role prerequisite for the refresh branch.

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.

Resources