Skip to main content
Glama

write_context

Store revisioned context bundles, documents, preferences, and one-time observations to keep scoped profile context auditable, requiring expected revisions and confirmation for sensitive defaults.

Instructions

Store a revisioned contextual bundle, document, preference or observation. Bundle meanings and defaults require exact user confirmation plus profile.write grants. Documents are untrusted supporting notes over readable ordinary profile facts; never include passwords, OTPs, mailbox content or financial values. Use observations for one-time choices. Profile intake and bundle creation can commit atomically. expected_revision=0 creates, later writes require the last revision. Restore only document revisions with unchanged evidence.

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": {
      "kind": "<kind>",
      "record_id": "<record_id>",
      "data": "<data>",
      "expected_revision": "<expected_revision>",
      "target_origin": "<target_origin>",
      "purpose": "<purpose>"
    },
    "name": "write_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesbundle: fields (semantic name to profile ID), subject, role, title, currentness (current/historical/unknown). document: bundle_refs, title, body (max 3000 characters). preference: one bundle_refs item, matching subject and role, optional valid_until (ISO date). observation: bundle_refs, outcome (used_once/accepted/corrected/rejected). Scope is exactly target_origin and purpose. No extra keys.
kindYes
sharedNoBundle meanings only: explicit approval to reuse this meaning across tasks. Does not grant access, change fact scopes or establish a default. Documents and preferences remain task-scoped.
purposeYes
confirmedNo
record_idYes
target_originYes
profile_entriesNoExact approved ordinary profile entries: {record: write_records profile entry, expected_updated_at: null for new or exact prior timestamp}. Only with a confirmed bundle.
restore_revisionNo
expected_revisionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.6/5.0
Behavior4/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 substantial work: it discloses the profile.write grant requirement, the exact-user-confirmation gate for bundle meanings and defaults, the untrusted status of documents, prohibited content (passwords, OTPs, mailbox content, financial values), and atomic commit of profile intake plus bundle creation. It stops short of describing failure behavior on revision mismatch or whether stored context can be deleted or overwritten.

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?

Seven short sentences for a 10-parameter mutation tool, front-loaded with the verb and resource, with no filler. The telegraphic, jargon-dense phrasing ('Bundle meanings and defaults require exact user confirmation plus profile.write grants') costs some readability but no sentence is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex, unannotated, no-output-schema mutation tool with nested objects and 30% schema coverage, the description covers safety, grants, revisioning, and kind selection well. Gaps remain around return values, conflict/error behavior, and the meaning of the required purpose and target_origin fields, which an agent needs to call this correctly.

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 coverage is only 30% across 10 parameters, so the description must compensate, and it does so for the highest-risk ones: expected_revision semantics (0 creates, otherwise last revision), restore_revision constraints, and the confirmation requirement behind 'confirmed'. It adds nothing for purpose, target_origin, or record_id, which remain opaque despite being required.

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?

Opens with a specific verb and resource set: 'Store a revisioned contextual bundle, document, preference or observation,' which tells an agent exactly what is written and the four record kinds. It does not explicitly contrast itself with the sibling write_records, so the boundary between context writes and record writes must be inferred from the 'profile_entries' mention.

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?

Gives real selection guidance among the kinds ('Use observations for one-time choices') and conditional rules ('expected_revision=0 creates, later writes require the last revision', 'Restore only document revisions with unchanged evidence'). However, it never states when to prefer this tool over write_records or get_task_context, and the confirmation/grant prerequisite is stated as a fact rather than as a precondition the agent must check first.

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