Skip to main content
Glama
xihuai18

claude-code-mcp

by xihuai18

claude_code_check

Destructive

Poll session state or answer pending permission requests to manage autonomous coding tasks.

Instructions

Poll session state or answer a pending permission request.

POLLING FREQUENCY: Do NOT poll every turn. Claude Code tasks take minutes, not seconds.

  • "running": sleep at least 2 minutes between polls; increase for complex tasks. Do NOT high-frequency poll — it wastes tokens.

  • "waiting_permission": poll ~1s and respond quickly.

  • "idle"/"error"/"cancelled": stop polling.

  • Adapt interval based on task complexity and whether the previous poll returned new events.

Main loop: call action='poll', persist nextCursor, and use action='respond_permission' for approvals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes'poll' fetches new events/actions/result; 'respond_permission' answers one pending permission request.
cursorNoDefault: 0. Pass the previous nextCursor to avoid replaying old buffered events.
decisionNoDefault: none. Required for action='respond_permission'. 'allow_for_session' reduces repeated prompts in the same session.
interruptNoDefault: false. When true, a deny decision also interrupts the whole session.
maxEventsNoDefault: 200 (minimal), unlimited (full/delta_compact)
requestIdNoDefault: none. Required for action='respond_permission'.
sessionIdYesSession ID returned by claude_code or claude_code_reply.
denyMessageNoDefault: 'Permission denied by caller'. Used only with decision='deny'.
pollOptionsNoDefault: none. Advanced polling payload controls for action='poll'.
responseModeNoDefault: 'minimal'. Use 'delta_compact' for compact event payloads; use 'full' mainly for diagnostics.
permissionOptionsNoDefault: none. Advanced permission response overrides for action='respond_permission'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
eventsYes
resultNo
statusYes
actionsNo
isErrorNo
sessionIdYes
truncatedNo
nextCursorNo
cancelledAtNo
lastEventIdNo
pollIntervalNo
cursorResetToNo
lastToolUseIdNo
availableToolsNo
compatWarningsNo
toolValidationNo
cancelledReasonNo
cancelledSourceNo
truncatedFieldsNo
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false. The description adds valuable behavioral context: explains token-wasting risks, the need for adaptive polling, and the ability to interrupt sessions via the interrupt parameter. It does not contradict annotations.

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 description is well-structured with clear headings for polling frequency and main loop. It is somewhat lengthy but every sentence adds essential context, especially given the tool's complexity. Could be slightly more concise, but overall efficient.

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?

Given the tool's complexity (11 parameters, nested objects, output schema exists), the description covers the high-level flow, polling states, and main loop adequately. It does not explain all edge cases, but schema descriptions handle parameter details. Completeness is strong.

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 description coverage is 100%, with each parameter already explained. The description adds semantic value by explaining how parameters like action, cursor, and decision fit into the polling loop and permission response flow, going beyond the schema's individual descriptions.

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 clearly states the tool polls session state or answers pending permission requests, with a specific verb+resource. It distinguishes from siblings (claude_code, claude_code_reply, claude_code_session) by its unique polling and permission-responding functionality.

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

Usage Guidelines5/5

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

Provides explicit polling frequency guidelines based on session state, including minimum intervals and when to stop polling. Also describes the main loop pattern and adapts intervals based on task complexity. This exceeds typical usage guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xihuai18/claude-code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server