Skip to main content
Glama
jasonwu001t

marketlens-mcp

by jasonwu001t

As-of align

analytics_align
Read-onlyIdempotent

Align two stored time series with an as-of join to line up different frequencies, keeping each left row and matching the latest or next right row within an optional tolerance.

Instructions

As-of join of two stored time series, computed locally in DuckDB (ASOF LEFT JOIN): every left row is kept and gets the right row that is the latest at or before its time (direction backward) or the first at or after it (forward), optionally within a tolerance (ISO-8601 duration, e.g. PT5M) and within the same by value (e.g. ticker). Output: the left columns, the chosen right columns (names that collide get the suffix, default _right) and matched_t, the matched right row's time; unmatched right values are None (no_match). Use it to line up series of different frequencies. Large outputs are stored and you get a result_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
byNoColumn present in both results to match within (e.g. ticker).
suffixNoAdded to right column names that collide._right
directionNobackward: the latest right row at or before the left time; forward: the first at or after.backward
toleranceNoLargest allowed time gap as an ISO-8601 duration (PT30S, PT5M, P1D); none by default.
right_columnsNoRight columns to bring over. Default: every right column except its time, by and absent.
left_result_idYesThe stored time series whose rows are kept (one output row per left row).
right_result_idYesThe stored time series matched to each left row.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, and the description adds substantial behavior beyond them: LEFT-join semantics (every left row is kept), collision suffixing on right column names, unmatched right values becoming None/no_match, the matched_t column, and the critical fact that large outputs are stored and returned as a result_id. That last detail is real operational context an agent cannot infer.

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?

Dense but front-loaded: the operation and join semantics come first, then options, then output shape. Every clause carries information, though the single run-on paragraph could be split for scanning; no filler sentences.

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 fully specifies the returned columns (left columns, chosen right columns with suffix, matched_t, None for no match) and the result_id escape hatch, and it covers all seven parameters. Nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description weaves the parameters into the join semantics rather than restating them — how direction, tolerance (ISO-8601, e.g. PT5M) and by (e.g. ticker) combine to select the matched row, and what default right_columns means. This adds contextual meaning beyond the per-field schema text.

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 names a specific operation (as-of join / ASOF LEFT JOIN) on a specific resource (two stored time series) and states the execution context (computed locally in DuckDB). An agent can distinguish it from siblings like analytics_resample or analytics_returns without opening the schema.

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?

It gives an explicit use case — 'Use it to line up series of different frequencies' — which tells the agent when this tool applies. It stops short of naming alternatives (e.g., analytics_resample) or stating when not to use it, so it clears the bar but isn't fully prescriptive.

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