get_session_state
Retrieve current debugging session state including active file, sent pages and frames, pending operations, and last update timestamp for Figma file interactions.
Instructions
Get current session state for debugging.
RETURNS:
Current file being explored
Pages and frames already sent
Pending continuation operations
Last update timestamp
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/handlers/session.js:18-28 (handler)The main handler function that retrieves the current session state using session.getState(), wraps it with chunker.wrapResponse, and returns it as a formatted text content block.export function getSessionState(ctx) { const { session, chunker } = ctx; const state = session.getState(); const response = chunker.wrapResponse(state, { step: "Session state retrieved", progress: state.currentFile ? "Active session" : "No active session", nextStep: "Use reset_session to clear state if needed", }); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; }
- src/tools/schemas.js:237-250 (schema)The JSON schema definition for the get_session_state tool, including name, description, and empty input schema (no parameters required).{ name: "get_session_state", description: `Get current session state for debugging. RETURNS: - Current file being explored - Pages and frames already sent - Pending continuation operations - Last update timestamp`, inputSchema: { type: "object", properties: {}, }, },
- src/index.js:98-100 (registration)Registration in the MCP server's CallToolRequestSchema handler switch statement, dispatching the tool call to handlers.getSessionState.case "get_session_state": result = handlers.getSessionState(this.ctx); break;
- src/tools/handlers/index.js:7-7 (registration)Re-export of the getSessionState handler from session.js, making it available via the handlers module.export { repeatLast, getSessionState, resetSession } from "./session.js";