agentbay_project_list
Retrieve a list of all projects you are currently a member of within your MCP workspace.
Instructions
List projects you are a member of
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:203-217 (registration)The tool 'agentbay_project_list' is registered with the MCP server via server.tool() on line 203. It has no input schema (empty object {}) and its handler function calls apiGet('/api/v1/projects') to list projects the user is a member of.
server.tool( 'agentbay_project_list', 'List projects you are a member of', {}, async () => { const data = await apiGet('/api/v1/projects'); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; const projects = data.projects || []; if (!projects.length) return { content: [{ type: 'text' as const, text: 'No projects found.' }] }; const text = projects.map((p: any) => `- **${p.name}** (${p.slug})\n ID: ${p.id} | Files: ${p._count?.files || 0} | Tasks: ${p._count?.tasks || 0}` ).join('\n'); return { content: [{ type: 'text' as const, text: `Your projects:\n\n${text}` }] }; } ); - src/index.ts:207-216 (handler)The handler implementation for agentbay_project_list. It fetches projects from the API, checks for errors, formats the project list with name, slug, ID, file count and task count, and returns the result as text content.
async () => { const data = await apiGet('/api/v1/projects'); if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] }; const projects = data.projects || []; if (!projects.length) return { content: [{ type: 'text' as const, text: 'No projects found.' }] }; const text = projects.map((p: any) => `- **${p.name}** (${p.slug})\n ID: ${p.id} | Files: ${p._count?.files || 0} | Tasks: ${p._count?.tasks || 0}` ).join('\n'); return { content: [{ type: 'text' as const, text: `Your projects:\n\n${text}` }] }; } - src/index.ts:206-206 (schema)The input schema for agentbay_project_list is an empty object ({}), meaning no parameters are required to call this tool.
{}, - src/index.ts:163-166 (helper)The apiGet helper function used by the handler to make the GET request to the AgentBay API.
async function apiGet(path: string) { const res = await fetch(`${API_BASE}${path}`, { headers: getHeaders() }); return res.json(); }