Skip to main content
Glama

get_draft

Read-only

Fetch a single draft by ID with headers, body, and attachment metadata; optionally save the JSON to a local path or retrieve metadata only.

Instructions

Fetch a single draft by ID, including headers, body, and attachment metadata.

Args: draft_id: The draft ID (from list_drafts or create_draft). local_path: Optional local filesystem path (file or directory) to write the draft JSON to instead of returning it inline. Bypasses the response-size cap, for drafts with very large bodies. A path ending in '/' is a directory, created if missing. A file in place of a parent directory, or at a path ending in '/', raises ValueError; an existing file at a plain file path is replaced. include_body: When False, fetch only metadata: no body is downloaded, and body_plain, body_html, and attachments are left out.

Returns: {"id": draft ID, "message": ...}, where message has the same shape as get_message's result (including its include_body=False shape and its body_decode_errors / body_fetch_errors). Raises an error naming the size if the draft is over the response-size cap and local_path is not set. If local_path is set, returns {local_path, draft_id, bytes_written} instead, plus body_fetch_errors / body_decode_errors (each entry with message_id) when present. On API failure, {"error": "..."}.

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>"
    },
    "name": "get_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
draft_idYes
local_pathNo
include_bodyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A3.9/5.0
Behavior1/5

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

The description is highly transparent about behavior, including that local_path may create a directory, replace an existing file, and raise ValueError in specified path-conflict cases. However, this directly contradicts readOnlyHint=true, which promises no environment modification: writing or replacing a local file is an environment mutation. Per the rubric, this annotation contradiction forces a score of 1.

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 Args and Returns structure is clear and front-loads the core purpose before edge cases. It is somewhat verbose and explains return shapes that an existing output schema may already cover, but the detail is mostly justified by the local_path and error-handling complexity.

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 read tool with non-trivial path-writing and error-handling behavior, the description covers the needed semantics: what is returned inline, what happens with local_path, how metadata-only fetches behave, and which errors can occur. Little an agent needs in order to call it correctly is missing, aside from the annotation conflict noted above.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning, and it does: it explains draft_id's origin, documents local_path's file/directory semantics and error behavior, and clarifies exactly what include_body=False omits. This adds substantial meaning beyond the bare schema.

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: fetch a single draft by ID, including headers, body, and attachment metadata. It also distinguishes the ID source (list_drafts or create_draft) and clarifies that the message shape matches get_message's result.

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?

Gives clear operational guidance: draft_id comes from list_drafts or create_draft, include_body=False fetches metadata only, and local_path is for bypassing the response-size cap. It does not explicitly compare get_draft against every sibling, but the intended usage is unambiguous.

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

Deploy Server

Other Tools