getProjects
Retrieve a list of projects from the Unleash feature flag management system to enable operations like creating, updating, and managing feature flags across different project environments.
Instructions
Retrieve a list of projects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:23-35 (handler)Core handler function that executes the tool logic: fetches list of projects from Unleash API using axios with bearer token auth.async function getProjects() { try { const response = await axios.get(`${UNLEASH_API_URL}/api/admin/projects`, { headers: { Authorization: `Bearer ${UNLEASH_AUTH_TOKEN}`, }, }); return response.data; } catch (error) { console.error('Error fetching projects:', error); throw error; } }
- src/index.ts:26-29 (registration)MCP server tool registration for 'getProjects', with description and thin wrapper handler that calls the core getProjects function and returns JSON stringified response in MCP format.server.tool('getProjects', 'Retrieve a list of projects', async () => { const data = await getProjects(); return { content: [{ type: 'text', text: JSON.stringify(data) }] }; });
- src/tools/index.ts:123-123 (helper)Export of the getProjects handler function for use in main server file.getProjects,