getDaos
Access and retrieve all DAOs within the Futarchy protocol on Solana through this tool, enabling efficient management and interaction with decentralized organizations.
Instructions
Get all DAOs from the Futarchy system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/server/index.ts:56-96 (handler)The MCP tool handler and registration for 'getDaos'. It calls the API client to fetch DAOs, handles success/error responses, and returns formatted text content.server.tool( "getDaos", "Get all DAOs from the Futarchy system", {}, async () => { try { const response = await apiClient.getDaos(); if (!response.success) { return { content: [ { type: "text" as const, text: response.error || 'Unknown error', }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: "text" as const, text: `Error fetching DAOs: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } } );
- src/mcp/common/types.ts:57-57 (schema)Zod schema for getDaos input parameters (empty object since no params required).export const GetDaosParamsSchema = z.object({});
- src/mcp/common/api.ts:16-34 (helper)The API client method getDaos() that performs an HTTP GET request to the backend API endpoint '/daos' and returns a standardized Response object.async getDaos(): Promise<Response> { try { const response = await fetch(`${this.baseUrl}/daos`); if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); } const data = await response.json(); return { success: true, data: data.daos }; } catch (error: any) { return { success: false, error: error.message || 'Failed to fetch DAOs' }; } }