Skip to main content
Glama
jasonwu001t

marketlens-mcp

by jasonwu001t

Query stored results

results_query
Read-onlyIdempotent

Run read-only SQL SELECT queries over session results in DuckDB, using result_ids as tables to join, filter, aggregate, or window market data.

Instructions

Run ONE read-only SQL SELECT (DuckDB dialect; WITH, joins, window functions, ASOF JOIN and time_bucket allowed) over results stored in this session, using each result_id as a table name. Returns at most max_rows rows (default 50, at most 200; a larger LIMIT is lowered). Larger answers, or store=true, are kept as a new result and you get its result_id. Files, settings, other sessions and every write are refused.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesOne read-only SELECT (or WITH ... SELECT) over this session's results; use each result_id as a table name, e.g. SELECT ticker, max(close) FROM r_8c1f0a9d3e GROUP BY ticker.
storeNoKeep the full answer (up to fetch.max_rows rows) as a new result and return its marker.
max_rowsNoRows to return (1-200). A LIMIT above it is lowered.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the row cap and the silent lowering of oversized LIMITs, the fact that large answers or store=true are materialized as a NEW result returned by result_id, and the exact refusal boundary. This side effect (a read that can create a new stored result) is precisely the kind of behavior annotations alone would hide.

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?

Three dense sentences, front-loaded with what the tool is, then return behavior, then the refusal boundary. No filler; every clause carries operative information.

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?

With no output schema, the description carries the return-value burden and does so: row count semantics, result_id for stored answers, and the scope of what is queryable and refused. An agent has everything needed to call it 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% and the schema already documents sql, store and max_rows (including the default and 200 cap). The description restates these limits rather than adding new semantics, so the baseline 3 applies.

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 (run ONE read-only SQL SELECT), the exact dialect (DuckDB) and constructs allowed, and the resource model (each result_id is a table name). An agent can distinguish it from results_list, results_describe and results_sample purely from the description.

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?

Clearly frames the operating context: query results already stored in this session, with explicit refusals (files, settings, other sessions, writes). It does not explicitly name a sibling alternative or say when to prefer results_list/results_sample over SQL, so routing guidance is implied rather than stated.

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