Skip to main content
Glama

Session Write File

session_write_file
DestructiveIdempotent

Write text files into a session workspace to seed input data for executed code. Overwrite existing files using relative paths, enabling custom inputs for code execution.

Instructions

Write a file into a session workspace (relative path, no escapes). Use this to seed input data for executed code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesRelative destination path inside the workspace; path escapes (e.g. '../') are refused
contentYesText content to write to `path`, overwriting any existing file
session_idYesId of the session workspace to write into

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.0
    • addedInput schema / properties / content / description
      Added value: +"Text content to write to `path`, overwriting any existing file"
    • addedInput schema / properties / path / description
      Added value: +"Relative destination path inside the workspace; path escapes (e.g. '../') are refused"
    • addedInput schema / properties / session_id / description
      Added value: +"Id of the session workspace to write into"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "session_write_fileDictOutput",
      +  "type": "object"
      +}
  3. Changed6 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / content / title
      Added value: +"Content"
    • addedInput schema / properties / path / title
      Added value: +"Path"
    • addedInput schema / properties / session_id / title
      Added value: +"Session Id"
    • addedInput schema / title
      Added value: +"session_write_fileArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true. The description adds useful behavioral context: it overwrites existing files (via the schema's content description) and refuses path escapes. It doesn't contradict annotations. It could mention that overwriting is destructive, but the annotation covers that.

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

Conciseness5/5

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

Two sentences with zero waste. The core action and constraint are front-loaded, and the use case is stated in the second sentence. Every word earns its place.

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

Completeness4/5

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

For a simple write tool with full schema coverage and an output schema, the description is complete enough. It covers the action, the constraint, and the use case. It doesn't explain return values, but the output schema exists, so that's not required.

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 all three parameters. The description adds the 'relative path, no escapes' constraint, which reinforces the path parameter's schema description. Baseline 3 is appropriate since the schema does the heavy lifting.

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 ('Write'), a specific resource ('a file into a session workspace'), and a key constraint ('relative path, no escapes'). It clearly distinguishes this from sibling tools like session_read_file and session_files by focusing on the write action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear use case: 'Use this to seed input data for executed code.' This tells the agent when to use it. It doesn't explicitly name alternatives or exclusions, but the context is clear enough given the sibling list.

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