Skip to main content
Glama

ask_claude_code

Run prompts through Claude Code headlessly in a selected profile and return the answer; enable edits only for file changes, with session IDs for terminal handoff.

Instructions

Run a prompt through Claude Code headlessly in a profile and return the answer.

Set allow_edits only when the user has asked for files to be changed. The returned session_id can be passed to handoff_to_terminal to continue the same session on screen.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
profileNo
allow_editsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the headless mode, that answers are returned, that a session_id comes back, and that edits only occur under an explicit flag. It omits permissions/auth requirements, what a profile implies, and any side-effect or concurrency caveats for a tool that can modify files.

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 compact sentences, front-loaded with the core action, followed by the two pieces of routing/behavioral guidance that matter most. No filler.

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?

No output schema and no annotations, so the description must stand alone; it covers the return value and the handoff flow but leaves the profile parameter and its interaction with list_profiles undefined. Adequate for a 3-parameter tool but with a visible gap.

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 0%, so the description must compensate. It explains allow_edits well but leaves profile ('in a profile') and prompt unexplained, and the relationship to the list_profiles sibling is not clarified.

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 ('Run a prompt through Claude Code headlessly') and the headless qualifier implicitly separates it from the screen-oriented sibling open_in_claude_code. An agent can identify the operation without opening the 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?

Gives a clear conditional rule for allow_edits ('only when the user has asked for files to be changed') and explains the handoff path via session_id. It does not, however, state when to prefer this headless tool over open_in_claude_code or how profile selection relates to list_profiles.

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