Skip to main content
Glama
tanmay4l

Futarchy MCP Server

by tanmay4l

createProposal

Submit new proposals for DAOs on Solana's Futarchy protocol by specifying DAO ID, description URL, and liquidity pool token amounts.

Instructions

Create a new proposal for a DAO

Input Schema

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

Implementation Reference

  • Registration of the 'createProposal' MCP tool using server.tool(), including inline input schema and handler function that delegates to apiClient.createProposal.
    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,
          };
        }
      }
    );
  • The async handler function for the 'createProposal' tool, which invokes the API client and formats the MCP response.
    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 for CreateProposalParams, matching the inline schema used in the tool registration. Defines input validation for daoId, descriptionUrl, baseTokensToLP, and quoteTokensToLP.
    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>;
  • Helper method in FutarchyApiClient that performs the actual HTTP POST request to create a proposal on the backend server.
    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'
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't address permissions required, whether this is an irreversible action, rate limits, or what happens upon success/failure. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized and front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool that creates proposals with 4 required parameters and no annotations or output schema, the description is insufficient. It doesn't explain what constitutes a valid proposal, what happens after creation, or potential side effects. The context demands more comprehensive guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new proposal') and target resource ('for a DAO'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential sibling tools that might also create proposals in different contexts, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. With sibling tools like getProposal and getProposals existing, there's no indication of when creation versus retrieval is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/tanmay4l/FutarchyMCPServer'

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