get_session_status
Check the current status and state of a Jules coding session to monitor autonomous tasks like bug fixes, refactoring, and test execution.
Instructions
Get the current status and state of a Jules session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session ID |
Implementation Reference
- src/mcp/tools.ts:244-260 (handler)Main handler function that executes the get_session_status tool logic, fetching session data from JulesClient and formatting response with next steps.async getSessionStatus( args: z.infer<typeof GetSessionStatusSchema> ): Promise<string> { return this.executeWithErrorHandling(async () => { const session = await this.client.getSession(args.session_id); return { sessionId: session.id, title: session.title, state: session.state, prompt: session.prompt, repository: session.sourceContext.source, updated: session.updateTime, nextSteps: this.getNextStepsForState(session.state || 'UNKNOWN'), }; }); }
- src/mcp/tools.ts:71-73 (schema)Zod input schema for validating arguments to the get_session_status tool.export const GetSessionStatusSchema = z.object({ session_id: z.string().describe('The ID of the session to check'), });
- src/index.ts:328-332 (registration)Registration in CallToolRequestSchema handler: parses args with schema and calls the tool handler.case 'get_session_status': { const validated = GetSessionStatusSchema.parse(args); result = await this.tools.getSessionStatus(validated); break; }
- src/index.ts:247-257 (registration)Tool metadata and JSON input schema advertised in ListToolsRequestSchema response.name: 'get_session_status', description: 'Get the current status and state of a Jules session', inputSchema: { type: 'object', properties: { session_id: { type: 'string', description: 'Session ID' }, }, required: ['session_id'], }, },
- src/mcp/tools.ts:388-404 (helper)Private helper method used by the handler to generate next-steps guidance based on session state.private getNextStepsForState(state: string): string { const stateGuide: Record<string, string> = { QUEUED: 'Session is queued. Wait for it to start planning.', PLANNING: 'Jules is generating a plan. Wait for plan completion.', AWAITING_PLAN_APPROVAL: 'Plan is ready. Read jules://sessions/{id}/full to review the plan, then call manage_session with action=approve_plan to proceed.', IN_PROGRESS: 'Session is executing. Monitor progress via jules://sessions/{id}/full.', COMPLETED: 'Session completed. Check the final activity for Pull Request URL or artifacts.', FAILED: 'Session failed. Review activities to diagnose the issue.', CANCELED: 'Session was canceled.', }; return stateGuide[state] || 'Unknown state. Check session activities.'; }