Skip to main content
Glama

list_devin_sessions

Retrieve and manage Devin sessions on the MCP-Devin server, enabling efficient tracking and organization of AI interactions within Slack. Supports pagination via limit and offset inputs.

Instructions

List all Devin sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of sessions to return
offsetNoNumber of sessions to skip

Implementation Reference

  • Handler for the 'list_devin_sessions' tool. Fetches the list of Devin sessions from the API endpoint `${BASE_URL}/session` with optional pagination parameters (limit, offset). Normalizes session IDs by stripping 'devin-' prefix and handles errors appropriately.
    case "list_devin_sessions": { const limit = Number(request.params.arguments?.limit) || undefined; const offset = Number(request.params.arguments?.offset) || undefined; try { const params: Record<string, any> = {}; if (limit !== undefined) params.limit = limit; if (offset !== undefined) params.offset = offset; const response = await axios.get( `${BASE_URL}/session`, { params, headers: getHeaders() } ); // セッション一覧の各セッションIDを正規化する const normalizedData = { ...response.data }; if (normalizedData.sessions && Array.isArray(normalizedData.sessions)) { normalizedData.sessions = normalizedData.sessions.map((session: { session_id?: string; [key: string]: any }) => { if (session.session_id) { return { ...session, original_session_id: session.session_id, session_id: normalizeSessionId(session.session_id) }; } return session; }); } return { content: [{ type: "text", text: JSON.stringify(normalizedData, null, 2) }] }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [{ type: "text", text: `Error listing sessions: ${error.response?.status} - ${JSON.stringify(error.response?.data)}` }], isError: true }; } return { content: [{ type: "text", text: `Unexpected error: ${error}` }], isError: true }; } }
  • Tool schema definition including name, description, and input schema for pagination (limit and offset). This is part of the tools list returned by ListToolsRequestHandler.
    { name: "list_devin_sessions", description: "List all Devin sessions", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of sessions to return" }, offset: { type: "number", description: "Number of sessions to skip" } } } },
  • Helper function used in the handler to normalize session IDs by removing the 'devin-' prefix.
    function normalizeSessionId(sessionId: string): string { return sessionId.replace(/^devin-/, ''); }

Other Tools

Related 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/kazuph/mcp-devin'

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