Skip to main content
Glama

get_session_state

Check the current status of a Jules session to determine if it's busy, stable, or failed, and view session details like last activity, agent messages, or pending plans.

Instructions

Get the current status of a Jules session. Acts as a dashboard to determine if Jules is busy, waiting, or failed.

RETURNS: id, status, url, title, prompt, pr (if created), lastActivity, lastAgentMessage (if any), pendingPlan (if awaiting approval)

STATUS (use this to decide what action to take):

  • "busy": Jules is actively working. Peek with get_code_review_context if needed.

  • "stable": Work is paused. Safe to review code, send messages, or check outputs.

  • "failed": System-level failure (like a 500). Session cannot continue.

LAST ACTIVITY:

  • Shows what just happened (activityId, type, timestamp)

  • Common types: agentMessaged, sessionCompleted, progressUpdated, userMessaged, planGenerated

LAST AGENT MESSAGE:

  • Contains the last message Jules sent (activityId, content, timestamp)

  • Read this to understand what Jules communicated

  • If Jules asked a question, you can respond using send_reply_to_session

PENDING PLAN:

  • Present when a plan is awaiting approval (lastActivity.type is 'planGenerated')

  • Contains planId and steps (title, description for each step)

  • Use send_reply_to_session with action 'approve' to approve the plan

NEXT ACTIONS:

  • busy → Wait for completion, or peek with get_code_review_context

  • stable + pendingPlan → Review the plan steps, then approve or send feedback

  • stable + lastAgentMessage → Read message, respond if Jules asked something

  • stable + no message → Review PR or code changes with get_code_review_context

  • failed → Report to user. Session is unrecoverable.

IMPORTANT:

  • You can send messages to ANY session regardless of status.

  • A session is never truly "done" unless it's failed. You can always continue the conversation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID (numeric string)
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and excels. It details return values (e.g., 'RETURNS: id, status, url...'), explains status meanings ('busy', 'stable', 'failed'), describes data structures ('LAST ACTIVITY', 'LAST AGENT MESSAGE', 'PENDING PLAN'), and outlines actionable insights ('NEXT ACTIONS'). It also clarifies operational constraints like 'A session is never truly "done" unless it's failed.'

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 sections (e.g., RETURNS, STATUS, NEXT ACTIONS) and front-loaded key information. However, it is lengthy due to comprehensive behavioral details, which are justified given the lack of annotations and output schema. Some redundancy exists (e.g., repeating tool names in examples), but overall, each sentence adds value for agent decision-making.

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?

Given the complexity of session management, no annotations, and no output schema, the description is highly complete. It thoroughly explains return values, status interpretations, behavioral implications, and next-step recommendations. It compensates for missing structured data by providing all necessary context for an agent to correctly invoke the tool and act on its results, referencing sibling tools where appropriate.

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?

The input schema has 100% description coverage, so the baseline is 3. The description adds value by implicitly contextualizing the 'sessionId' parameter through examples of returned data (e.g., 'id', 'url') and usage scenarios, though it doesn't explicitly explain the parameter beyond what the schema states. This elevates the score above baseline but not to a 5, as no new parameter-specific details are introduced.

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 explicitly states the tool's purpose: 'Get the current status of a Jules session. Acts as a dashboard to determine if Jules is busy, waiting, or failed.' It uses specific verbs ('Get', 'determine'), identifies the resource ('Jules session'), and distinguishes from siblings by focusing on status retrieval rather than creation, listing, or messaging.

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?

The description provides explicit guidance on when to use this tool and alternatives. The 'NEXT ACTIONS' section details specific scenarios (e.g., 'busy → Wait for completion, or peek with get_code_review_context'), and it references sibling tools like 'get_code_review_context' and 'send_reply_to_session' for follow-up actions. It also clarifies that 'You can send messages to ANY session regardless of status,' preventing misuse.

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/streetquant/jules-mcp'

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