Skip to main content
Glama
alucardeht
by alucardeht

repeat_last

Retrieve the previous Figma API response from session state to recover context or reference data without making new API calls.

Instructions

Repeat the last response without making new API calls.

HOW IT WORKS:

  • Returns exact same response from session state

  • No Figma API call needed

  • Useful for context recovery

WHEN TO USE:

  • Lost context and need to see previous data

  • Want to reference last response again

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'repeat_last' tool. It retrieves the last response from the session state and returns it directly. If no previous response exists, it returns a formatted error message instructing the user to make a request first.
    export function repeatLast(ctx) { const { session, chunker } = ctx; const lastResponse = session.getLastResponse(); if (!lastResponse) { const response = chunker.wrapResponse( { message: "No previous response in session" }, { step: "Repeat failed", nextStep: "Make a request first, then use repeat_last", } ); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] }; } return lastResponse; }
  • The JSON schema definition for the 'repeat_last' tool, specifying its name, detailed description, and empty input schema (no parameters required).
    { name: "repeat_last", description: `Repeat the last response without making new API calls. HOW IT WORKS: - Returns exact same response from session state - No Figma API call needed - Useful for context recovery WHEN TO USE: - Lost context and need to see previous data - Want to reference last response again`, inputSchema: { type: "object", properties: {}, }, },
  • src/index.js:95-97 (registration)
    Registration of the 'repeat_last' tool in the main MCP server request handler. Matches the tool name in the switch statement and invokes the handler function.
    case "repeat_last": result = handlers.repeatLast(this.ctx); break;
  • Export statement in handlers index that re-exports the repeatLast function from session.js, making it available for import in the main index.js.
    export { repeatLast, getSessionState, resetSession } from "./session.js";
  • src/index.js:38-38 (registration)
    Special handling registration: 'repeat_last' is exempted from requiring FIGMA_API_TOKEN since it doesn't make API calls.
    if (!FIGMA_API_TOKEN && !["repeat_last", "get_session_state", "reset_session"].includes(name)) {

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/alucardeht/figma-mcp'

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