Skip to main content
Glama
tanmay4l
by tanmay4l

getDaos

Retrieve all DAOs from the Futarchy protocol on Solana to manage decentralized organizations and proposals.

Instructions

Get all DAOs from the Futarchy system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server tool registration including the handler function for 'getDaos'. The handler invokes apiClient.getDaos(), processes the response, and returns formatted JSON or error text.
    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, }; } } );
  • Core implementation of getDaos method in FutarchyApiClient. Performs HTTP GET to backend /daos endpoint and wraps response in standardized Response format.
    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' }; } }
  • Zod schema defining input parameters for getDaos tool (empty object, no parameters required).
    export const GetDaosParamsSchema = z.object({});
  • Explicit registration of the 'getDaos' tool on the MCP server with name, description, input schema, and handler function.
    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, }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tanmay4l/FutarchyMCPServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server