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;
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