Skip to main content
Glama

list_sessions

Browse exploratory sessions for a project. Filter by status, state, assignee, release, tags, or search by name. Sort and paginate results.

Instructions

Browse exploratory sessions for a project. Filter by status (active|closed), state, sessionType, assigneeUserId, release (releaseId), tags, or free-text search on name. Pass releaseId='none' for sessions not attached to a release. Default page size 25 (max 200).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID (required).
searchNoMatch by session name.
statusNo
stateNoWorkflow state. Either canonical ('under_review', 'done') or display ('Under review', 'Done') form — the server normalizes lowercase+underscored.
sessionTypeNo
assigneeUserIdNoUser _id OR email — both accepted (server resolves email to user _id).
releaseIdNo'none' for unlinked sessions.
tagsNoSingle tag or comma-separated.
isClosedNo
sortByNo
sortOrderNo
pageNo
limitNoDefault 25 (max 200).

Implementation Reference

  • The main handler function that executes the 'list_sessions' tool logic. It takes args (projectId, filters), builds the API URL via endpoints.listSessions, makes an authenticated GET request, and returns the response as text content.
    export async function handleListSessions(args?: ListSessionsArgs) {
      const token = getApiKey(args);
      if (!token) {
        throw new Error(
          "Missing TESTDINO_PAT environment variable. Configure it in your .cursor/mcp.json under 'env'."
        );
      }
      if (!args?.projectId) throw new Error("projectId is required");
    
      try {
        const { releaseId, assigneeUserId, ...rest } = args;
        const url = endpoints.listSessions({
          ...rest,
          ...(releaseId ? { milestone: releaseId } : {}),
          ...(assigneeUserId ? { assignee: assigneeUserId } : {}),
        });
        const response = await apiRequestJson<unknown>(url, {
          headers: { Authorization: `Bearer ${token}` },
        });
        return {
          content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
        };
      } catch (error) {
        const msg = error instanceof Error ? error.message : String(error);
        throw new Error(`Failed to list sessions: ${msg}`);
      }
    }
  • Tool registration object including the name 'list_sessions', description, and inputSchema (JSON Schema) defining all parameters: projectId (required), search, status, state, sessionType, assigneeUserId, releaseId, tags, isClosed, sortBy, sortOrder, page, limit.
    export const listSessionsTool = {
      name: "list_sessions",
      description:
        "Browse exploratory sessions for a project. Filter by status (active|closed), state, sessionType, assigneeUserId, release (releaseId), tags, or free-text search on name. Pass releaseId='none' for sessions not attached to a release. Default page size 25 (max 200).",
      inputSchema: {
        type: "object",
        properties: {
          projectId: { type: "string", description: "Project ID (required)." },
          search: { type: "string", description: "Match by session name." },
          status: { type: "string", enum: ["active", "closed"] },
          state: {
            type: "string",
            description:
              "Workflow state. Either canonical ('under_review', 'done') or display ('Under review', 'Done') form — the server normalizes lowercase+underscored.",
          },
          sessionType: { type: "string" },
          assigneeUserId: {
            type: "string",
            description:
              "User _id OR email — both accepted (server resolves email to user _id).",
          },
          releaseId: {
            type: "string",
            description: "'none' for unlinked sessions.",
          },
          tags: { type: "string", description: "Single tag or comma-separated." },
          isClosed: { type: "boolean" },
          sortBy: { type: "string", enum: ["createdAt", "updatedAt", "name"] },
          sortOrder: { type: "string", enum: ["asc", "desc"] },
          page: { type: "number" },
          limit: { type: "number", description: "Default 25 (max 200)." },
        },
        required: ["projectId"],
      },
    };
  • src/index.ts:327-332 (registration)
    Route in the main server's CallToolRequestSchema handler that matches the name 'list_sessions' and dispatches to the handleListSessions function.
    // Sessions
    if (name === "list_sessions") {
      return await handleListSessions(
        args as Parameters<typeof handleListSessions>[0]
      );
    }
  • src/index.ts:125-130 (registration)
    Tool definition registration: listSessionsTool is included in the tools array passed to ListToolsRequestSchema, making it visible as an available MCP tool.
      // Sessions
      listSessionsTool,
      getSessionTool,
      createSessionTool,
      updateSessionTool,
    ];
  • Endpoint helper: constructs the URL for the list sessions API call (GET /api/mcp/sessions/:projectId) with query parameters.
    /**
     * List exploratory sessions
     * GET /api/mcp/sessions/:projectId
     */
    listSessions: (params: {
      projectId: string;
      search?: string;
      status?: string;
      state?: string;
      sessionType?: string;
      assignee?: string;
      milestone?: string;
      tags?: string;
      isClosed?: boolean;
      sortBy?: string;
      sortOrder?: string;
      page?: number;
      limit?: number;
    }): string => {
      const baseUrl = getBaseUrl();
      const { projectId, ...queryParams } = params;
      const queryString = buildQueryString(queryParams);
      return `${baseUrl}/api/mcp/sessions/${projectId}${queryString}`;
    },
Behavior3/5

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

No annotations are provided, so the description alone must convey behavioral traits. It discloses pagination defaults (page size 25, max 200) but does not explicitly state that the operation is read-only or non-destructive, nor mentions authentication or rate limits. The absence of annotations increases the burden, and the description partially meets it.

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 three sentences: purpose, filter list, and pagination default. It is front-loaded with the core action and immediately provides actionable filtering details. No extraneous information.

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

Completeness4/5

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

The description covers the main functionality (filtered list) and pagination, but lacks any mention of the response structure or return value. Given the absence of an output schema, this omission is notable. However, for a typical list tool, the description is reasonably complete.

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

Parameters4/5

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

Schema description coverage is 54%. The description adds meaningful context beyond the schema: it explains that state accepts both canonical and display forms (with normalization), assigneeUserId accepts ID or email, and releaseId='none' for unlinked sessions. These details help correct usage. However, some parameters (sortBy, sortOrder, page) are only indirectly mentioned via the page size note, leaving gaps.

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 action ('Browse exploratory sessions') and the resource ('for a project'). It distinguishes from siblings like 'get_session' (single session retrieval) and 'list_manual_runs' (different resource).

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

Usage Guidelines4/5

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

The description lists multiple filters and gives examples like releaseId='none', but does not explicitly contrast with alternative tools (e.g., 'list_manual_runs') or state when not to use this tool. It implies usage for filtered browsing but lacks explicit when-to-use guidance.

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

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/testdino-hq/testdino-mcp'

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