getDao
Retrieve a specific DAO by its ID from the Futarchy protocol on Solana to access governance information and manage proposals.
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:98-139 (handler)MCP tool handler implementation for 'getDao'. Validates input, fetches DAO data using apiClient, handles success/error responses, and returns markdown-compatible content.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/api.ts:36-54 (helper)Core helper method in FutarchyApiClient that performs HTTP GET request to backend API endpoint `/daos/{daoId}` to retrieve specific DAO information.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}` }; } }
- src/mcp/common/types.ts:59-61 (schema)Zod schema defining input parameters for getDao tool (matches inline schema in handler).export const GetDaoParamsSchema = z.object({ daoId: z.string().describe("The ID of the DAO to retrieve"), });
- src/mcp/common/types.ts:13-20 (schema)TypeScript type and Zod schema for DAO data structure returned by the tool.export const DaoSchema = z.object({ address: z.string(), tokenMint: z.string(), usdcMint: z.string(), // Add other DAO fields as needed }); export type Dao = z.infer<typeof DaoSchema>;