Skip to main content
Glama

enter_position

Enter a position in an open pool by selecting a token from a pair, with earlier entries receiving higher conviction multipliers. Requires an agent API key and USDC commitment.

Instructions

Enter an open pool with a position on one side of a token pair. Requires an agent API key (from create_agent). Earlier entries earn a higher conviction multiplier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_keyNoAgent API key from create_agent (starts with cfm_). Auto-filled from saved credentials if omitted.
token_aYesFirst token in the pair (e.g. BTC)
token_bYesSecond token in the pair (e.g. ETH)
sideYesWhich token to pick (e.g. BTC or ETH)
amountNoAmount in USDC to commit (minimum 1)

Implementation Reference

  • The 'enter_position' tool handler, which validates the API key and sends a request to the server to place a bet in a pool on-chain.
    // ── Tool: place_bet ──
    
    server.tool(
      "enter_position",
      "Enter an open pool with a position on one side of a token pair. Requires an agent API key (from create_agent). Earlier entries earn a higher conviction multiplier.",
      {
        api_key: z.string().optional().describe("Agent API key from create_agent (starts with cfm_). Auto-filled from saved credentials if omitted."),
        token_a: z.string().describe("First token in the pair (e.g. BTC)"),
        token_b: z.string().describe("Second token in the pair (e.g. ETH)"),
        side: z.string().describe("Which token to pick (e.g. BTC or ETH)"),
        amount: z.number().min(1).default(1).describe("Amount in USDC to commit (minimum 1)"),
      },
      async ({ api_key, token_a, token_b, side, amount }) => {
        const resolvedKey = api_key || getDefaultApiKey();
        if (!resolvedKey) {
          return {
            content: [{ type: "text", text: "No API key found. Create an agent first with `create_agent`, or pass an `api_key`." }],
            isError: true,
          };
        }
    
        const result = (await apiPost("agent-place-bet", {
          agentApiKey: resolvedKey,
          tokenAId: token_a.toUpperCase(),
          tokenBId: token_b.toUpperCase(),
          selectedSide: side.toUpperCase(),
          amountUsdc: amount,
        })) as any;
    
        if (!result.success) {
          const rawError = result.error || "Unknown error";
          return {
            content: [{ type: "text", text: `Entry failed: ${humanizeError(rawError)}` }],
            isError: true,
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: [
                "# Entry Placed",
                "",
                `**Pool:** ${token_a.toUpperCase()}-${token_b.toUpperCase()}`,
                `**Side:** ${side.toUpperCase()}`,
                `**Amount:** $${amount}`,
                `**Conviction Multiplier:** ${result.convictionMultiplier?.toFixed(3) ?? "1.000"}`,
                `**Win Probability:** ${result.winProbability?.toFixed(1) ?? "?"}%`,
                result.explorerUrl ? `**Transaction:** ${result.explorerUrl}` : "",
              ]
                .filter(Boolean)
                .join("\n"),
            },
          ],
        };
      }
    );
Behavior3/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 mentions the requirement for an agent API key and the conviction multiplier effect, which are useful behavioral traits. However, it lacks details on permissions, rate limits, or what happens upon execution (e.g., confirmation, errors). This leaves gaps for a mutation tool.

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 two sentences with zero waste: the first states the core action and prerequisites, and the second adds a key behavioral nuance (conviction multiplier). It's front-loaded and efficiently structured.

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

Completeness3/5

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

Given no annotations and no output schema, the description is incomplete for a mutation tool with 5 parameters. It covers prerequisites and a behavioral trait but lacks details on permissions, side effects, or return values. This is adequate but has clear gaps, scoring as minimum viable.

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 the schema fully documents all parameters. The description adds minimal value beyond the schema by implying the 'api_key' is from 'create_agent' and hinting at the 'amount' being in USDC, but these are already covered. Baseline 3 is appropriate as the schema does the heavy lifting.

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 ('enter an open pool') and resource ('with a position on one side of a token pair'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from potential siblings like 'get_pools' or 'get_pool_history' that might involve pools but don't create positions.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: it requires an agent API key from 'create_agent' and mentions that earlier entries earn higher conviction multipliers, implying timing considerations. It doesn't explicitly state when not to use it or name alternatives among siblings, but the prerequisites are well-specified.

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/abcxz/conviction-fm'

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