list_namespaces
Retrieve all available namespaces in Flipt MCP Server to manage and organize feature flags, segments, and evaluations efficiently for AI-driven interactions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:25-35 (handler)MCP tool registration and handler implementation for 'list_namespaces'. Fetches namespaces using fliptClient and returns them as formatted JSON text content.server.tool('list_namespaces', {}, async args => { const namespaces = await fliptClient.listNamespaces(); return { content: [ { type: 'text', text: JSON.stringify(namespaces, null, 2), }, ], }; });
- src/services/fliptClient.ts:106-121 (helper)Helper service method in FliptClient that invokes the generated NamespacesServiceApi.listNamespaces() to retrieve the list of namespaces, handling response and errors.async listNamespaces() { try { const response = await this.namespacesApi.listNamespaces(); // The response is a NamespaceList object, not a response with a data property if (response && response.namespaces) { return response.namespaces; } else { console.error('Unexpected response structure:', response); return []; } } catch (error) { console.error('Error getting namespaces:', error); return []; } }