Skip to main content
Glama

FinBridge

FinBridge DB Read-Only SQL

query_db
Read-only

Run a single read-only SELECT query against the local finbridge database (ingested KR/US fundamentals, filings, daily prices). The statement must start with SELECT or WITH; multiple statements, PRAGMA, and any write/DDL keywords (INSERT/UPDATE/DELETE/DROP/ALTER/CREATE/ATTACH/...) are rejected. The query is executed as SELECT * FROM () LIMIT on a read-only connection.

Args:

  • sql: one SELECT (or WITH ... SELECT) statement. A single trailing ';' is tolerated.

  • limit: max rows returned, 1-500 (default 50)

  • response_format: 'markdown' (default, table) or 'json' (compact)

Returns: {columns: [name], rows: [[cell, ...]], row_count, truncated} — truncated=true means more rows matched than 'limit'.

Examples (v_financials / v_latest_annual views are the easiest entry points):

  • Largest companies by latest annual revenue: "SELECT name, ticker, stock_code, fiscal_year, revenue FROM v_latest_annual ORDER BY revenue DESC LIMIT 10"

  • Samsung Electronics annual trend: "SELECT fiscal_year, revenue, operating_income, net_income FROM v_financials WHERE stock_code = '005930' AND quarter = 0 ORDER BY fiscal_year DESC"

  • KR vs US company counts: "SELECT source, COUNT(*) AS n FROM companies GROUP BY source"

  • Recent Samsung Electronics closes: "SELECT date, close FROM prices_daily p JOIN companies c ON c.id = p.company_id WHERE c.stock_code = '005930' ORDER BY date DESC LIMIT 20" (prices_daily holds KR, US, TW; US history starts 2023-03-28)

Use when: custom aggregation/joins over ingested data that screen_companies cannot express. Don't use for anything that writes — it will be rejected — or for live quotes (use the live-source tools). Errors: non-SELECT input, ';' inside, or forbidden keywords -> rejected with the reason; unknown table/column -> SQL error with a hint to call get_db_schema first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single read-only SELECT (or WITH ... SELECT) statement
limitNoMax rows returned, 1-500 (default 50)
response_formatNo'markdown' for a table, 'json' for compact machine-readable outputmarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
columnsYes
row_countYes
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The description goes far beyond the readOnlyHint annotation by disclosing the exact execution model: the query is wrapped as SELECT * FROM (<sql>) LIMIT <limit> on a read-only connection, and forbidden constructs such as PRAGMA, multiple statements, and DDL keywords are rejected. It also explains the truncated flag semantics and error behavior, giving the agent a realistic picture of outcomes before invoking.

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?

The description is long but well-structured with clear sections (Args, Returns, Examples, Use when, Errors), and every part earns its place for a tool with nontrivial constraints. Core rules are front-loaded before parameters and examples, and no filler or tautological phrasing is present.

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?

For a complex SQL-execution tool, the description is remarkably complete: it covers accepted syntax, rejected patterns, result shape, row limits, error behavior, example queries, and alternative tools. With an output schema and readOnlyHint already present, nothing essential is missing for an agent to select and invoke this tool correctly.

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 coverage is 100%, so the baseline is 3, but the description adds value through concrete examples that clarify how sql, limit, and response_format work together, including real view names and join patterns. It also adds nuances the schema lacks, such as tolerating a single trailing ';' and noting which data sources and date ranges are available.

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 opens with a specific verb and resource: 'Run a single read-only SELECT query against the local finbridge database,' and names the data domains (KR/US fundamentals, filings, daily prices). It clearly distinguishes itself from siblings by emphasizing the custom SQL/read-only scope, so an agent can tell it apart from screen_companies or get_stock_prices.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use it ('custom aggregation/joins over ingested data that screen_companies cannot express') and when not to use it ('Don't use for anything that writes... or for live quotes'), even directing to 'live-source tools' as alternatives. It also provides the error-recovery hint to call get_db_schema first for unknown tables.

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.

TDQS

A4.2/5.0
Disambiguation4/5

Most tools have clearly distinct resource+action targets, and the overlapping screen_* tools are thoroughly cross-referenced with 'use screen_X instead' guidance. Minor ambiguity exists between get_disclosure_feed, get_dart_filings, and get_dart_major_events, which all surface KR filings from different angles but remain distinguishable.

Naming Consistency5/5

Every tool follows a consistent verb_noun snake_case pattern: get_* for retrievers, screen_* for screeners, search_* for lookups, plus action verbs like analyze_, backtest_, compare_, import_, and query_. Subfamilies (dart_*, edgar_*, fred_*, crypto_*) are consistently prefixed, making tool selection predictable.

Tool Count3/5

37 tools is heavy, and the four momentum screeners (canslim/kell/minervini/schwartz) plus three KR disclosure tools could arguably be collapsed into parameterized variants. However, the server's unusually broad scope—KR/US/TW/JP/EU equities, crypto, macro, portfolio, backtesting—means most tools earn their place, so the count is high but not chaotic.

Completeness4/5

The surface covers the core workflow well: search, prices, fundamentals, filings, insider trades, valuation, screeners, backtesting, and portfolio tracking for KR/US, plus crypto and macro. Notable gaps are the lack of single-company financial-statement tools for TW/JP/EU (only available through screen_companies) and no real-time stock quotes, but these are workable for the stated local-database research purpose.

Resources