Skip to main content
Glama
tanmay4l

Futarchy MCP Server

by tanmay4l

sellInPassMarket

Sell tokens in a proposal's pass market to manage DAO investments on Solana. Execute trades based on market predictions for proposal outcomes.

Instructions

Sell tokens in the pass market for a proposal

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
proposalIdYesThe ID of the proposal to trade in
amountYesAmount to sell
userYesUser's public key

Implementation Reference

  • MCP server tool registration for 'sellInPassMarket', including input schema (Zod) and handler function that proxies to FutarchyApiClient
    server.tool(
      "sellInPassMarket",
      "Sell tokens in the pass market for a proposal",
      {
        proposalId: z.string().describe("The ID of the proposal to trade in"),
        amount: z.number().describe("Amount to sell"),
        user: z.string().describe("User's public key"),
      },
      async ({ proposalId, amount, user }) => {
        try {
          const response = await apiClient.sellInPassMarket(proposalId, amount, user);
          
          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 selling in pass market: ${error.message || 'Unknown error'}`,
              },
            ],
            isError: true,
          };
        }
      }
    );
  • FutarchyApiClient method that implements the sellInPassMarket API call to the backend server endpoint /proposals/{proposalId}/sell-pass
    async sellInPassMarket(proposalId: string, amount: number, userPublicKey: string): Promise<Response> {
      try {
        const response = await fetch(`${this.baseUrl}/proposals/${proposalId}/sell-pass`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({
            amount,
            user: userPublicKey
          })
        });
    
        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 sell in pass market'
        };
      }
    }
  • Zod input schema for the sellInPassMarket MCP tool
    {
      proposalId: z.string().describe("The ID of the proposal to trade in"),
      amount: z.number().describe("Amount to sell"),
      user: z.string().describe("User's public key"),
    },
  • Helper script defining simplified parameter types for backend routes integration
    "mcp_futarchy_routes_sellInPassMarket": {
      "proposalId": "string",
      "amount": "number",
      "user": "string"
    },
    "mcp_futarchy_routes_buyInFailMarket": {
      "proposalId": "string",
      "amount": "number",
      "user": "string"
    },
    "mcp_futarchy_routes_sellInFailMarket": {
      "proposalId": "string",
      "amount": "number",
      "user": "string"
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool sells tokens, implying a write/mutation operation, but does not disclose any behavioral traits such as permissions needed, rate limits, side effects, or what happens upon execution. This is a significant gap for a tool that likely involves financial transactions.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy to parse quickly.

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?

Given the complexity of a token-selling operation with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits, usage context, and expected outcomes, leaving critical gaps for an AI agent to understand how to invoke this tool safely and effectively.

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?

The input schema has 100% description coverage, providing clear documentation for all three parameters. The description does not add any additional meaning or context beyond what the schema already specifies, such as explaining the relationship between parameters or usage nuances. This meets the baseline for high schema coverage.

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 ('sell tokens') and the context ('in the pass market for a proposal'), which is specific and actionable. However, it does not explicitly distinguish this tool from its sibling 'sellInFailMarket', which likely sells tokens in a different market context, leaving some ambiguity in sibling differentiation.

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, such as 'sellInFailMarket' or 'buyInPassMarket'. It lacks context on prerequisites, conditions, or exclusions, leaving the agent to infer usage based on tool names alone.

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