Skip to main content
Glama

createProposal

Submit a new proposal for a DAO on the Futarchy protocol by specifying the DAO ID, proposal description URL, and token amounts for liquidity provision. Simplifies DAO governance on Solana.

Instructions

Create a new proposal for a DAO

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseTokensToLPYesAmount of base tokens to LP
daoIdYesThe ID of the DAO to create a proposal for
descriptionUrlYesURL to the proposal description
quoteTokensToLPYesAmount of quote tokens to LP

Implementation Reference

  • MCP tool handler for 'createProposal' that delegates to FutarchyApiClient.createProposal and formats the response as MCP-standard content with error handling.
    async (params) => { try { const response = await apiClient.createProposal({ daoId: params.daoId, descriptionUrl: params.descriptionUrl, baseTokensToLP: params.baseTokensToLP, quoteTokensToLP: params.quoteTokensToLP }); 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 creating proposal: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } }
  • Registration of the 'createProposal' tool on the MCP server using server.tool, including description, inline input schema, and handler function.
    server.tool( "createProposal", "Create a new proposal for a DAO", { daoId: z.string().describe("The ID of the DAO to create a proposal for"), descriptionUrl: z.string().describe("URL to the proposal description"), baseTokensToLP: z.number().describe("Amount of base tokens to LP"), quoteTokensToLP: z.number().describe("Amount of quote tokens to LP"), }, async (params) => { try { const response = await apiClient.createProposal({ daoId: params.daoId, descriptionUrl: params.descriptionUrl, baseTokensToLP: params.baseTokensToLP, quoteTokensToLP: params.quoteTokensToLP }); 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 creating proposal: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } }
  • Zod schema definition and TypeScript type for CreateProposalParams used in the tool and API client.
    export const CreateProposalParamsSchema = z.object({ daoId: z.string().describe("The ID of the DAO to create a proposal for"), descriptionUrl: z.string().describe("URL to the proposal description"), baseTokensToLP: z.number().describe("Amount of base tokens to LP"), quoteTokensToLP: z.number().describe("Amount of quote tokens to LP"), }); export const GetSentimentAnalysisParamsSchema = z.object({ proposalId: z.string().describe("The ID of the proposal to analyze"), }); // Types for params export type GetDaosParams = z.infer<typeof GetDaosParamsSchema>; export type GetDaoParams = z.infer<typeof GetDaoParamsSchema>; export type GetProposalsParams = z.infer<typeof GetProposalsParamsSchema>; export type GetProposalParams = z.infer<typeof GetProposalParamsSchema>; export type CreateProposalParams = z.infer<typeof CreateProposalParamsSchema>;
  • FutarchyApiClient method that proxies the createProposal request via HTTP POST to the backend API endpoint.
    async createProposal(params: CreateProposalParams): Promise<Response> { try { const { daoId, descriptionUrl, baseTokensToLP, quoteTokensToLP } = params; const response = await fetch(`${this.baseUrl}/daos/${daoId}/proposals`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ descriptionUrl, baseTokensToLP, quoteTokensToLP }) }); if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); } const data = await response.json(); return { success: true, data: data }; } catch (error: any) { return { success: false, error: error.message || 'Failed to create proposal' }; } }

Other Tools

Related Tools

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/TanmayDhobale/FutarchyMCPServer'

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