Skip to main content
Glama

get_recent_sales

Retrieve the most actively traded municipal bond CUSIPs with key details including coupon, maturity, price/yield, trade count, and total amount to gauge live-market conditions for comparable deals.

Instructions

Most actively traded muni CUSIPs right now from EMMA's /TradeData grid — description, coupon, maturity, high/low price & yield, trade count, total trade amount, and a link to each security's EMMA detail page. Use this to gauge live-market color for comparable deals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • server.py:457-470 (registration)
    Tool registration for 'get_recent_sales' — defines the tool name, description, and input schema (limit param, default 25) in the list_tools() handler.
    Tool(
        name="get_recent_sales",
        description=(
            "Most actively traded muni CUSIPs right now from EMMA's "
            "/TradeData grid — description, coupon, maturity, high/low "
            "price & yield, trade count, total trade amount, and a link "
            "to each security's EMMA detail page. Use this to gauge "
            "live-market color for comparable deals."
        ),
        inputSchema={
            "type": "object",
            "properties": {"limit": {"type": "integer", "default": 25}},
        },
    ),
  • Handler implementation for 'get_recent_sales' — navigates to EMMA /TradeData, scrapes the #lvTradeData table (description, coupon, maturity, high/low price & yield, trade count, total trade amount, security_url, cusip_hash), then returns structured sales data capped by the limit parameter.
    if name == "get_recent_sales":
        url = f"{EMMA_BASE}/TradeData"
        async with new_page() as page:
            await page.goto(url, wait_until=NAV_WAIT, timeout=NAV_TIMEOUT_MS)
            try:
                await page.wait_for_selector("#lvTradeData tbody tr", timeout=15000)
            except Exception:
                pass
            await page.wait_for_timeout(500)
            data = await page.evaluate(
                """() => {
                    const t = document.getElementById('lvTradeData');
                    if (!t) return {head: [], rows: []};
                    const head = Array.from(t.querySelectorAll('thead th')).map(th => th.innerText.replace(/\\s+/g,' ').trim());
                    const rows = Array.from(t.querySelectorAll('tbody tr')).map(tr => {
                        const cells = Array.from(tr.cells).map(td => td.innerText.trim());
                        const a = tr.querySelector('a[href*="/Security/Details/"]');
                        const cusipImg = tr.querySelector('img[data-cusip9]');
                        return {
                            cells,
                            security_url: a ? a.href : null,
                            cusip_hash: cusipImg ? cusipImg.getAttribute('data-cusip9') : null,
                        };
                    });
                    return {head, rows};
                }"""
            )
        sales: list[dict[str, Any]] = []
        for r in data.get("rows", []):
            item = structured(data.get("head", []), [r.get("cells", [])])
            if not item:
                continue
            s = item[0]
            if r.get("security_url"):
                s["security_url"] = r["security_url"]
            if r.get("cusip_hash"):
                s["cusip_hash"] = r["cusip_hash"]
            sales.append(s)
        limit = int(args.get("limit", 25))
        return {"count": len(sales), "sales": sales[:limit]}
  • Helper function 'structured()' — converts raw header/rows from scraped tables into a list of dicts. Used by get_recent_sales to transform scraped trade row cells into key-value pairs.
    def structured(header: list[str], rows: list[list[str]]) -> list[dict[str, str]]:
        out = []
        for r in rows:
            if len(r) <= 1:
                continue
            item: dict[str, str] = {}
            for i, col in enumerate(r):
                key = header[i] if i < len(header) else f"col{i}"
                key = key.replace("\n", " ").strip()
                if key:
                    item[key] = col
            if item:
                out.append(item)
        return out
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the data source (EMMA's /TradeData grid) and the returned fields, but does not mention behavior such as idempotency, data freshness, or whether the operation is read-only. It is not contradictory but lacks deeper behavioral context.

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?

The description is a single sentence followed by a usage statement, which is concise and front-loaded with the most important information. It could be structured more cleanly, but there is no wasted text.

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

Completeness4/5

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

For a simple tool with one parameter and no output schema, the description adequately explains the data source, purpose, and returned fields. It does not mention ordering of results or that the limit parameter controls result count, but the context is largely complete.

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

Parameters2/5

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

The input schema has one parameter ('limit') with zero schema description coverage, and the description does not mention the limit parameter at all. The agent must infer its meaning from the parameter name alone, which is insufficient.

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 that the tool retrieves 'most actively traded muni CUSIPs right now from EMMA's /TradeData grid' and enumerates the returned fields (description, coupon, maturity, prices, yield, trade count, amount, link). This distinguishes it from siblings like 'get_market_pulse' or 'get_security_details' which serve different purposes.

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 phrase 'Use this to gauge live-market color for comparable deals' provides clear context for when to use the tool. While it does not explicitly exclude alternatives, the specific purpose is well-defined and implicit in the description.

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/ark9164-create/blaylock-emma-mcp'

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