Skip to main content
Glama

run_filter

Filter live Tehran Stock Exchange symbols by custom boolean conditions. Use TSETMC syntax or friendly aliases for price, volume, order book, and money flow fields to find matching stocks.

Instructions

Run a custom stock filter over the live market and return matching symbols.

expression is a boolean condition over a symbol's fields. Accepts TSETMC filter syntax — e.g. (ct).Buy_I_Volume-(ct).Sell_I_Volume>0 && (plp)>0 — OR friendly aliases — e.g. net_individual > 0 and change_pct > 0. Call filter_help() first to see all variables (price/volume/eps/pe, حقیقی-حقوقی ct_*, order-book, buy_queue()). Order-book/صف filters enrich a shortlist on demand (capped by enrich_limit). Pass save_as to store the filter under a name for reuse. Returns {rows, matched, returned, normalized, tier, meta}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
save_asNo
expressionYes
descriptionNo
enrich_limitNo
Behavior4/5

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

With no annotations, the description discloses that the tool runs over live market data, returns matching symbols with a specific structure {rows, matched, returned, normalized, tier, meta}, and that order-book filters enrich a shortlist on demand with a cap. This provides good behavioral transparency for a read-only query tool.

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 two paragraphs with front-loaded purpose. It uses examples and lists key points efficiently without wasted words. Could be slightly more structured (e.g., separating parameter descriptions), but overall it is concise.

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 the complexity (custom syntax, 5 params, no output schema), the description covers the main aspects: syntax, prerequisite, return format, and order-book behavior. However, it omits meanings for 'limit' and 'description' parameters, and the return fields are listed but not explained, leaving some gaps.

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 0%, so the description must compensate. It explains 'expression' in detail with examples, mentions 'save_as' for storing filters, and 'enrich_limit' for order-book. However, 'limit' and 'description' are not explained, leaving gaps for two of five parameters. Partial but insufficient compensation.

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 runs a custom stock filter over the live market and returns matching symbols. It distinguishes from siblings like 'run_saved_filter' by emphasizing it's for custom expressions, and mentions 'filter_help' as a prerequisite, making the specific purpose clear.

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 description advises calling filter_help first to see available variables, and explains the two syntax options (TSETMC and friendly aliases). It also notes that order-book filters require setting enrich_limit. However, it does not explicitly state when to use this tool versus alternatives like 'screen' or 'run_saved_filter', though the sibling list implies those use cases.

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/solitraderbusiness/tsetmc-mcp'

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