Skip to main content
Glama

list_projects

Retrieve all accessible PingCode projects with identifiers and names to manage work items, releases, bugs, and requirements through AI assistants.

Instructions

列出用户可访问的所有项目。返回项目标识和名称列表。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'list_projects' tool. It fetches all accessible projects via pingcodeClient.getProjects(), formats them into a markdown bullet list with project identifiers and names, and returns structured success/data/error.
    export async function listProjects(): Promise<{ success: boolean; data?: string; error?: string; }> { try { const projects = await pingcodeClient.getProjects(); if (projects.length === 0) { return { success: true, data: '没有可访问的项目', }; } const lines: string[] = [ '# 项目列表', '', `共 ${projects.length} 个项目`, '', ]; projects.forEach((project: any) => { const identifier = project.identifier || project._id; const name = project.name || '未命名'; lines.push(`- **${identifier}** - ${name}`); }); return { success: true, data: lines.join('\n'), }; } catch (error: any) { return { success: false, error: error.message, }; } }
  • src/index.ts:129-137 (registration)
    Tool registration in the MCP ListTools response. Defines the tool name, description, and input schema (no parameters required).
    { name: 'list_projects', description: '列出用户可访问的所有项目。返回项目标识和名称列表。', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • Dispatch handler in the MCP CallToolRequest handler that invokes the listProjects function and formats the response as MCP content.
    case 'list_projects': { const result = await listProjects(); return { content: [ { type: 'text', text: result.success ? result.data! : `错误: ${result.error}`, }, ], isError: !result.success, }; }
  • Input schema definition for the list_projects tool (empty object, no required parameters).
    inputSchema: { type: 'object', properties: {}, required: [], },

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/ratatatat1/pingcode-mcp'

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