getDao
Retrieve a specific DAO by its ID using the Futarchy MCP Server on Solana, simplifying DAO management and integration with the Futarchy protocol.
Instructions
Get a specific DAO by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| daoId | Yes | The ID of the DAO to retrieve |
Implementation Reference
- src/mcp/server/index.ts:104-139 (handler)Handler function that executes the getDao tool: calls apiClient.getDao(daoId), handles response or error, returns formatted MCP content.async ({ daoId }) => { try { const response = await apiClient.getDao(daoId); 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 DAO: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } }
- src/mcp/server/index.ts:98-140 (registration)MCP server.tool registration for the 'getDao' tool, specifying name, description, input schema (daoId), and inline handler.server.tool( "getDao", "Get a specific DAO by ID", { daoId: z.string().describe("The ID of the DAO to retrieve"), }, async ({ daoId }) => { try { const response = await apiClient.getDao(daoId); 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 DAO: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } } );
- src/mcp/common/types.ts:59-61 (schema)Zod schema defining input parameters for getDao tool (matches inline schema used in registration).export const GetDaoParamsSchema = z.object({ daoId: z.string().describe("The ID of the DAO to retrieve"), });
- src/mcp/common/api.ts:36-54 (helper)FutarchyApiClient.getDao method: performs HTTP GET to backend /daos/{daoId}, parses response into standardized Response format.async getDao(daoId: string): Promise<Response> { try { const response = await fetch(`${this.baseUrl}/daos/${daoId}`); if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); } const data = await response.json(); return { success: true, data: data.dao }; } catch (error: any) { return { success: false, error: error.message || `Failed to fetch DAO with ID: ${daoId}` }; } }