Skip to main content
Glama

list_projects

Retrieve a list of projects from CODING DevOps based on user permissions, optionally filtered by project name, using the MCP interface to manage and organize resources efficiently.

Instructions

查询当前用户在 CODING DevOps 中的项目列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameNo项目名称,支持模糊匹配

Implementation Reference

  • The core handler function for the 'list_projects' tool. It initializes the CodingConnection, retrieves projects (optionally filtered by name), formats them into a markdown list, and returns as MCP content. Handles errors appropriately.
    export async function listProjects(args: Record<string, unknown> | undefined, config: CodingDevOpsConfig) {
      CodingConnection.initialize(config);
      const connection = CodingConnection.getInstance();
    
      try {
        const projectName = args?.projectName as string | undefined;
        const projects = await connection.listProjects(projectName);
    
        return {
          content: [
            {
              type: 'text',
              text: `**Projects**\n${
                projects.map(project => 
                  `- **${project.Name}** (${project.DisplayName || 'No display name'})
              - ID: ${project.Id || 'N/A'}
              - Description: ${project.Description || 'No description provided'}\n`
                ).join('\n')
              }`,
            },
          ],
        };
      } catch (error: unknown) {
        if (error instanceof McpError) throw error;
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to list projects: ${errorMessage}`
        );
      }
    }
  • The tool definition object in the definitions array, specifying the name, description, and input schema (optional projectName string) for 'list_projects'.
    {
      name: 'list_projects',
      description: '查询当前用户在 CODING DevOps 中的项目列表',
      inputSchema: {
        type: 'object',
        properties: {
          projectName: { 
            type: 'string', 
            description: '项目名称,支持模糊匹配' 
          }
        },
        required: [],
      }
    },
  • TypeScript interface defining the input arguments for listProjects, with optional projectName.
    export interface ListProjectsArgs {
      projectName?: string;
      [key: string]: unknown;
    }
  • The projectTools export providing an initialize function that binds the listProjects handler (imported from ./list.js) with config, and exposes the tool definitions for registration.
    export const projectTools = {
      initialize: (config: CodingDevOpsConfig) => ({
        listProjects: (args: ListProjectsArgs) => listProjects(args, config),
        createProject: (args: CreateProjectArgs) => createProject(args, config),
        deleteProject: (args: DeleteProjectArgs) => deleteProject(args, config),
        definitions,
      }),
      definitions,
    };
  • src/index.ts:108-110 (registration)
    In the main MCP server tool dispatch switch statement, the case for 'list_projects' that invokes the bound project.listProjects handler.
    case 'list_projects':
      result = await tools.project.listProjects(request.params.arguments);
      break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool queries project lists, implying a read-only operation, but doesn't disclose any behavioral traits such as authentication requirements, rate limits, pagination, error handling, or what the return format looks like (e.g., list structure, fields included). For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves beyond basic purpose.

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, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence contributes essential information (verb, resource, scope), earning 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 the tool's complexity (a query operation with 1 parameter), lack of annotations, and no output schema, the description is incomplete. It covers the basic purpose but fails to address behavioral aspects (e.g., authentication, response format) or usage guidelines. For a tool with no structured data beyond the input schema, more context is needed to ensure the agent can use it effectively.

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 input schema has 1 parameter with 100% description coverage ('项目名称,支持模糊匹配' - project name, supports fuzzy matching). The description adds no additional meaning beyond what the schema provides, as it doesn't mention parameters at all. With high schema coverage, the baseline is 3, as the schema adequately documents the parameter, but the description doesn't compensate or enhance understanding.

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 tool's purpose: '查询当前用户在 CODING DevOps 中的项目列表' (Query the current user's project list in CODING DevOps). It specifies the verb '查询' (query) and resource '项目列表' (project list), and identifies the scope as '当前用户' (current user) in 'CODING DevOps'. However, it doesn't explicitly differentiate from sibling tools like 'list_issues' or 'create_project', which would require mentioning it's for listing projects specifically, not issues or creating projects.

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 sibling tools like 'list_issues' (for listing issues) or 'create_project' (for creating projects), nor does it specify prerequisites, exclusions, or contexts for usage. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

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/yupengfei1209/coding_devops_mcp_server'

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