Skip to main content
Glama
aiterm-mcp
by kitepon

image_read

Reads image files (PNG, JPEG, GIF, WebP) up to 25 MiB from a session’s allowed folders and returns their bytes; use offset/length to fetch large images in chunks or relay files from another computer.

Instructions

席の端末にある画像ファイル1枚(絶対path、png/jpeg/gif/webp、25 MiBまで)のバイト列を返す。別端末の席はsession_idだけで現地のファイルを読む(1通の上限を超えないよう、現地とは一片ずつやり取りして1枚にして返す)。読める場所は、席の作業フォルダと一時フォルダの中だけ(symlinkは解いてから見る)。誤りのcode: IMAGE_PATH_INVALID / IMAGE_NOT_FOUND / IMAGE_PATH_NOT_ALLOWED / IMAGE_NOT_AN_IMAGE / IMAGE_TOO_LARGE。length を付けると、offsetから最大 length バイトの一片をchunk_base64で返す(Aiterm同士の中継用)。

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": {
      "session_id": "<session_id>",
      "path": "<path>"
    },
    "name": "image_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes画像ファイルの絶対path(席の端末の上のpath)
lengthNo一片で読む時の長さ(6 MiBまで)。省略すると画像1枚をimageで返す
offsetNo一片で読む時の開始バイト
remoteNo別端末のAitermで実行する時のSSH接続情報。hostだけならssh_configの接続名として使う。Aitermは接続情報を保存・管理しない。passphraseは会話記録に残るため、ssh-agentかpassphrase_env(環境変数名)を推奨する。
session_idYes

Output Schema

NameRequiredDescriptionDefault
pathYes
bytesNo
offsetNo
schemaYes
sha256Yes
mime_typeYes
session_idYes
total_bytesNo
chunk_base64No

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.70.112

TDQS

A4.4/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 well: it discloses the sandbox (only the seat's work folder and temp folder), that symlinks are resolved before the check, the 25 MiB limit, the 6 MiB chunk limit, and the exact error codes (IMAGE_PATH_INVALID, IMAGE_NOT_FOUND, IMAGE_PATH_NOT_ALLOWED, IMAGE_NOT_AN_IMAGE, IMAGE_TOO_LARGE). What is missing is an explicit statement that this is a read-only operation and any auth/permission requirements for remote seats.

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?

Front-loaded with the core behavior (one image, absolute path, formats, size), then the remote/chunking rules, then the sandbox, then error codes. Dense but every sentence adds operational detail; the parenthetical asides add slight clutter but no filler.

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 tool with nested SSH parameters and an output schema, the description supplies everything an agent needs to call it correctly: size/format constraints, sandbox boundaries, chunking protocol, and a full error taxonomy. Return-value shape is legitimately left to the output schema.

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 already 80%, so the baseline is 3, but the description adds real meaning: it explains the offset/length pairing as a chunked read returning chunk_base64 and clarifies that session_id alone addresses another machine's local file. It does not explain the nested remote/ssh object, which the schema itself documents.

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?

States a specific verb and resource (returns the byte stream of a single image file), plus the accepted formats (png/jpeg/gif/webp) and the 25 MiB cap. An agent can immediately distinguish it from image_put and the pty/stream readers without opening a schema.

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?

Makes clear when to pass only session_id for a remote seat and when to use offset/length to relay one image in pieces. It gives clear context but never explicitly excludes or names an alternative tool, so the routing is implied rather than stated.

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