Skip to main content
Glama

get_devin_session

Retrieve details of a Devin session, including optional Slack messages, to maintain context between AI tasks and Slack threads using the MCP-Devin server.

Instructions

Get information about an existing Devin session and optionally fetch associated Slack messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fetch_slack_infoNoWhether to fetch associated Slack messages (if available)
session_idYesThe ID of the Devin session

Implementation Reference

  • Handler for the 'get_devin_session' tool. Fetches session information from the Devin API using the provided session_id, optionally retrieves associated messages if fetch_slack_info is true, normalizes the session ID by removing 'devin-' prefix, and returns the data as a JSON string.
    case "get_devin_session": {
      const session_id = String(request.params.arguments?.session_id);
      const fetch_slack_info = Boolean(request.params.arguments?.fetch_slack_info);
    
      if (!session_id) {
        return {
          content: [{
            type: "text",
            text: "Error: session_id is required"
          }],
          isError: true
        };
      }
    
      try {
        // Get session info from Devin API
        const response = await axios.get(
          `${BASE_URL}/session/${normalizeSessionId(session_id)}`,
          { headers: getHeaders() }
        );
        
        // If requested, try to fetch additional Slack info about this session
        let data = response.data;
        
        if (fetch_slack_info) {
          try {
            // This is a simplified approach - in a real implementation you would need
            // to store the slack_channel and slack_message_ts in a database associated with the session_id
            const sessionResponse = await axios.get(
              `${BASE_URL}/session/${normalizeSessionId(session_id)}/message`,
              { headers: getHeaders() }
            );
            
            data = {
              ...data,
              messages: sessionResponse.data.messages
            };
          } catch (slackError) {
            console.error('Error fetching Slack info:', slackError);
          }
        }
    
        // セッションIDを正規化して返す
        if (data && data.session_id) {
          data = {
            ...data,
            original_session_id: data.session_id,
            session_id: normalizeSessionId(data.session_id)
          };
        }
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify(data, null, 2)
          }]
        };
      } catch (error) {
        if (axios.isAxiosError(error)) {
          return {
            content: [{
              type: "text",
              text: `Error getting session: ${error.response?.status} - ${JSON.stringify(error.response?.data)}`
            }],
            isError: true
          };
        }
        
        return {
          content: [{
            type: "text",
            text: `Unexpected error: ${error}`
          }],
          isError: true
        };
      }
    }
  • Input schema definition for the 'get_devin_session' tool, specifying required 'session_id' parameter and optional 'fetch_slack_info' boolean.
    {
      name: "get_devin_session",
      description: "Get information about an existing Devin session and optionally fetch associated Slack messages",
      inputSchema: {
        type: "object",
        properties: {
          session_id: {
            type: "string",
            description: "The ID of the Devin session"
          },
          fetch_slack_info: {
            type: "boolean",
            description: "Whether to fetch associated Slack messages (if available)"
          }
        },
        required: ["session_id"]
      }
    },
  • Helper function used in get_devin_session handler to remove 'devin-' prefix from session IDs for API calls and normalization.
    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 the full burden of behavioral disclosure. It states the tool retrieves information, which implies read-only behavior, but fails to disclose critical traits such as authentication requirements, rate limits, error conditions, or what 'information' includes beyond Slack messages, leaving significant gaps for an agent.

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 a single, well-structured sentence that front-loads the core purpose ('Get information about an existing Devin session') and efficiently adds the optional feature ('and optionally fetch associated Slack messages'), with zero wasted words or redundancy.

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 the lack of annotations and output schema, the description is incomplete for a tool with 2 parameters and behavioral complexity. It doesn't explain what 'information' is returned, how errors are handled, or prerequisites like session existence, leaving the agent with insufficient context for reliable invocation.

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?

The schema description coverage is 100%, with clear descriptions for both parameters (session_id and fetch_slack_info). The description adds minimal value beyond the schema by mentioning 'optionally fetch associated Slack messages', which aligns with fetch_slack_info, but doesn't provide additional context like format or constraints, meeting the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('Get information about an existing Devin session') and resources ('Devin session', 'associated Slack messages'), distinguishing it from siblings like create_devin_session (creates new), list_devin_sessions (lists multiple), and send_message_to_session (sends messages).

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

Usage Guidelines3/5

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

The description implies usage by mentioning 'existing Devin session' (suggesting it's for retrieval rather than creation) and 'optionally fetch associated Slack messages' (hinting at an alternative use case), but it lacks explicit guidance on when to use this versus alternatives like list_devin_sessions or detailed exclusions.

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