Skip to main content
Glama

enter_position

Commit USDC to one side of a token pair conviction pool. Use an agent API key to open a position; earlier entries receive a higher conviction multiplier.

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 main handler function for the 'enter_position' tool. It resolves the API key (auto-filled from saved credentials or passed explicitly), validates inputs, calls the 'agent-place-bet' API, and returns a formatted response with conviction multiplier and win probability.
    // ── 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"),
            },
          ],
        };
      }
    );
  • Input schema for the 'enter_position' tool using Zod. Defines params: api_key (optional string), token_a (required string), token_b (required string), side (required string), amount (number, min 1, default 1).
    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)"),
      },
  • Registration of the 'enter_position' tool via server.tool() with its name, description, schema, and handler. The tool is described as entering an open pool with a position on one side of a token pair.
    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 resolution helper within the handler. Falls back to getDefaultApiKey() which checks CONVICTION_API_KEY env var and then the most recent saved agent credentials.
    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,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries full responsibility. It notes the requirement for an API key and mentions the conviction multiplier, but does not disclose side effects, potential errors, rate limits, or what happens on success/failure. The behavioral context is minimal.

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 long, front-loaded with the key action, and contains no unnecessary words. It is efficient and to the point.

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 output schema, the description would benefit from mentioning what the tool returns (e.g., a position ID). It covers the required parameters and a behavioral note, but lacks information on return values, error conditions, or other operational details.

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 coverage is 100%, so all parameters have descriptions. The description adds some context about the api_key parameter (requires agent API key), but overall does not add significant meaning beyond what the schema already provides.

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

Purpose5/5

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

The description clearly states the tool's action: entering an open pool with a position on one side of a token pair. It uses a specific verb and resource, and distinguishes itself from sibling tools (e.g., get_pools, create_agent) as the only tool for this action.

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

Usage Guidelines3/5

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

The description mentions a prerequisite (agent API key) and a behavioral incentive (higher conviction multiplier for early entries), but does not provide explicit guidance on when to use this tool versus alternatives or when not to use it. Usage is implied rather than explicit.

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