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-/, '');
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, what permissions might be required, whether results are paginated (though parameters suggest they might be), or what format the returned sessions will have. The description adds almost no behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence with no wasted words. It's front-loaded with the essential information (the action and resource) and contains no unnecessary elaboration. This is an example of efficient communication where every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there are no annotations and no output schema, the description is incomplete for a tool that presumably returns session data. For a list operation with pagination parameters, the description should ideally mention what information sessions contain, whether results are ordered, or what authentication might be required. The minimal description leaves significant gaps in understanding the tool's behavior and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already fully documents both parameters (limit and offset). The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline of 3 for high schema coverage situations where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('all Devin sessions'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential siblings like 'get_devin_session' or explain what distinguishes 'list' from 'get' operations in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_devin_session' (presumably for retrieving a specific session) and 'send_message_to_session' (for interacting with sessions), the description offers no context about when listing all sessions is appropriate versus using more targeted tools.

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

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