Skip to main content
Glama

Macro & Commodities Desk

Kelly Position Size

kelly_size
Read-only

Compute the optimal Kelly position size for a prediction-market contract. Given your win probability, the market price (which sets the payout), your bankroll, and a Kelly fraction (full / half / quarter / eighth), returns the dollar stake and a risk rating. Use for "how much should I stake", "what is my position size", "Kelly sizing for this trade".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bankrollNoTotal bankroll in dollars (e.g. 1000). Optional — omit it and the result is the % of bankroll to stake, without a dollar figure. Accepts a number or a numeric string ("1000", "$1,000").
fractionNoKelly fraction to apply. Half-Kelly is the common sharp-money default. One of: full · half · quarter · eighth.
marketPriceYesContract price in cents (1–99). Sets the payout ratio. Accepts 55, "55%", "55¢", "$0.55", 0.55 or American odds (+120 / -150) — all read as 55%.
winProbabilityYesYour probability the contract resolves YES, in % (0–100). Accepts 55, "55%", "55¢", "$0.55", 0.55 or American odds (+120 / -150) — all read as 55%.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratingNoQualitative read of the sizing.
sourcesNo
tell_userNoShow this sentence to the user first.
timestampNo
needs_inputNo
example_callNo
stake_dollarsNoSuggested stake in dollars (when a bankroll was given).
data_freshnessNo
full_kelly_pctNoFull-Kelly fraction of bankroll, %.
applied_fraction_pctNoThe fraction applied, %.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / properties / bankroll / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / bankroll / type
      Added value: +[
      +  "number",
      +  "string"
      +]
    • removedInput schema / properties / marketPrice / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / marketPrice / type
      Added value: +[
      +  "number",
      +  "string"
      +]
    • removedInput schema / properties / winProbability / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / winProbability / type
      Added value: +[
      +  "number",
      +  "string"
      +]
  2. Changed5 schema fields changed
    • addedInput schema / properties / fraction / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "enum": [
      +      "full",
      +      "half",
      +      "quarter",
      +      "eighth"
      +    ],
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / fraction / default
      Removed value: -"half"
    • changedInput schema / properties / fraction / description
      Previous value: -"Kelly fraction to apply. Half-Kelly is the common sharp-money default."New value: +"Kelly fraction to apply. Half-Kelly is the common sharp-money default. One of: full · half · quarter · eighth."
    • removedInput schema / properties / fraction / enum
      Removed value: -[
      -  "full",
      -  "half",
      -  "quarter",
      -  "eighth"
      -]
    • removedInput schema / properties / fraction / type
      Removed value: -"string"
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "applied_fraction_pct": {
      +      "description": "The fraction applied, %."
      +    },
      +    "data_freshness": {},
      +    "example_call": {},
      +    "full_kelly_pct": {
      +      "description": "Full-Kelly fraction of bankroll, %."
      +    },
      +    "needs_input": {},
      +    "rating": {
      +      "description": "Qualitative read of the sizing."
      +    },
      +    "sources": {},
      +    "stake_dollars": {
      +      "description": "Suggested stake in dollars (when a bankroll was given)."
      +    },
      +    "tell_user": {
      +      "description": "Show this sentence to the user first.",
      +      "type": "string"
      +    },
      +    "timestamp": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description usefully adds that the tool is a pure computation returning a stake amount and a risk rating, which tells the agent there are no side effects. It doesn't discuss edge cases such as invalid probabilities or the meaning of the risk rating, keeping it short of a 5.

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

Conciseness4/5

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

Three compact sentences, front-loaded with the core action and its inputs/outputs before the example triggers. Every sentence earns its place, though the trailing quoted-phrase list is slightly listy and could be trimmed.

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

Completeness5/5

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

An output schema exists, yet the description still concisely previews the return ('dollar stake and a risk rating'), and it names all four inputs with the optional bankroll implication clear via the schema. For a stateless calculator this is fully sufficient to call correctly.

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 already documents each parameter in detail (bankroll optionality, accepted price/probability formats, fraction values). The description restates the same inputs — 'win probability, market price (which sets the payout), your bankroll, a Kelly fraction (full / half / quarter / eighth)' — adding only the note that market price sets the payout. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Compute the optimal Kelly position size for a prediction-market contract') and goes on to name the exact inputs and outputs, so it is clearly separable from siblings like calculate_ev and convert_probability. An agent knows immediately what this tool returns (dollar stake + risk rating).

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?

Provides concrete triggering phrases — "how much should I stake", "what is my position size", "Kelly sizing for this trade" — which give clear context for when to reach for this tool. It stops short of naming when NOT to use it or pointing to alternative siblings (e.g. calculate_ev for edge, not sizing).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.