Skip to main content
Glama
comet-ml

Opik MCP Server

by comet-ml

list-projects

Retrieve a paginated list of projects or workspaces from the Opik MCP Server. Supports sorting, filtering by workspace name, and customizable page size for efficient project management.

Instructions

Get a list of projects/workspaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYesPage number for pagination
sizeYesNumber of items per page
sortByNoSort projects by this field
sortOrderNoSort order (asc or desc)
workspaceNameNoWorkspace name to use instead of the default

Implementation Reference

  • The main handler function for the 'list-projects' tool. It constructs the API URL with pagination parameters, calls makeApiRequest to fetch projects from the Opik API, and returns formatted MCP content blocks with summary and JSON data.
      async (args: any) => {
        const { page, size, workspaceName } = args;
        const url = `/v1/private/projects?page=${page}&size=${size}`;
    
        const response = await makeApiRequest<ProjectResponse>(url, {}, workspaceName);
    
        if (!response.data) {
          return {
            content: [{ type: 'text', text: response.error || 'Failed to fetch projects' }],
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `Found ${response.data.total} projects (page ${response.data.page} of ${Math.ceil(response.data.total / response.data.size)})`,
            },
            {
              type: 'text',
              text: JSON.stringify(response.data.content, null, 2),
            },
          ],
        };
      }
    );
  • Zod schema defining the input parameters for the 'list-projects' tool: optional page (default 1), size (default 10), and workspaceName.
    {
      page: z.number().optional().default(1).describe('Page number for pagination'),
      size: z.number().optional().default(10).describe('Number of items per page'),
      workspaceName: z.string().optional().describe('Workspace name to use instead of the default'),
    },
  • Registration of the 'list-projects' tool using server.tool(), including the tool name, description, input schema, and handler function within the loadProjectTools loader.
    server.tool(
      'list-projects',
      'Get a list of projects with optional filtering',
      {
        page: z.number().optional().default(1).describe('Page number for pagination'),
        size: z.number().optional().default(10).describe('Number of items per page'),
        workspaceName: z.string().optional().describe('Workspace name to use instead of the default'),
      },
      async (args: any) => {
        const { page, size, workspaceName } = args;
        const url = `/v1/private/projects?page=${page}&size=${size}`;
    
        const response = await makeApiRequest<ProjectResponse>(url, {}, workspaceName);
    
        if (!response.data) {
          return {
            content: [{ type: 'text', text: response.error || 'Failed to fetch projects' }],
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `Found ${response.data.total} projects (page ${response.data.page} of ${Math.ceil(response.data.total / response.data.size)})`,
            },
            {
              type: 'text',
              text: JSON.stringify(response.data.content, null, 2),
            },
          ],
        };
      }
    );
  • src/index.ts:86-89 (registration)
    Top-level conditional registration of project tools (including 'list-projects') by calling loadProjectTools(server) when 'projects' toolset is enabled.
    if (config.enabledToolsets.includes('projects')) {
      server = loadProjectTools(server);
      logToFile('Loaded projects toolset');
    }
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. It states it 'gets a list' which implies a read operation, but doesn't mention pagination behavior (implied by parameters), rate limits, authentication requirements, or what the return format looks like. For a tool with 5 parameters and no output schema, this leaves significant behavioral aspects undocumented.

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 at just 5 words, front-loading the core purpose with zero wasted words. Every element ('Get', 'list', 'projects/workspaces') earns its place. No structural issues or unnecessary elaboration.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what a 'project' or 'workspace' represents in this context, doesn't describe the return format, and provides no behavioral context. The agent would need to infer too much from just the schema parameters.

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?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's already in the schema descriptions. It doesn't explain relationships between parameters (e.g., how 'workspaceName' interacts with the list) or provide usage examples. Baseline 3 is appropriate when 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 action ('Get a list') and resource ('projects/workspaces'), making the purpose immediately understandable. However, it doesn't distinguish between 'projects' and 'workspaces' or clarify if they're synonymous, and it doesn't differentiate from sibling tools like 'get-project-by-id' or 'list-prompts' which serve different but related purposes.

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. It doesn't mention when to choose 'list-projects' over 'get-project-by-id' for retrieving specific projects, or 'list-prompts' for different resource types. There are no prerequisites, exclusions, or context for usage decisions.

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/comet-ml/opik-mcp'

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