Skip to main content
Glama
shigechika

jquants-mcp

by shigechika

health_check

Read-onlyIdempotent

Check server health, API key status, and cache readiness before querying Japanese stock data. Use after timeouts to distinguish cache-loading delays from permanent failures.

Instructions

Check server health, API key configuration, and cache readiness.

Offloaded to a worker thread (see _health_check_impl): the body can trigger the slow lazy cache initialization (connect + migrations), and the official mcp SDK — unlike the standalone fastmcp package this server used to run on — invokes sync tool bodies directly on the event loop rather than in a worker thread, so an explicit asyncio.to_thread offload is required here to keep that work off the loop. Sharing the SQLite connection with the loop from that thread is what caused #537; the store's write lock, not this offload, is what makes it safe.

Call this at session start to confirm cache.db has finished loading before issuing detect_* or cache_status — the first call after server start may take 10–60 seconds while the cache initialises lazily. After a tool-call timeout, use this to distinguish a transient cache-loading delay from a permanent failure.

Returns server version, API key status, active plan, status (healthy / degraded), cache_integrity and cache_ready.

status is degraded only when the integrity check reports a failure; there is no error state, since this call does no I/O that can fail.

cache_integrity (ok / pending / not-checked / failed: / error: ) is the integrity check's own result. The last two carry a detail string appended to the prefix, so test them with startswith, not ==. cache_ready is a boolean shorthand: true only when cache_integrity is exactly "ok".

In multi-user mode, returns the authenticated user's plan.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds rich behavioral context beyond annotations: offloaded to a worker thread due to SDK event-loop behavior, potential 10-60s first-call delay from lazy cache initialization, no error state, meaning of status/cache_integrity/cache_ready values, and multi-user plan behavior. This far exceeds the read-only/idempotent annotation hints.

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?

Although lengthy, the description is densely informative and well-structured. It opens with a concise one-sentence purpose, then adds essential technical rationale (thread offload, SDK behavior, issue #537), usage timing, and detailed return-value semantics. Every sentence earns its place and no filler exists.

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?

Given the tool's moderate complexity, non-existent parameters, and rich output schema, the description fully covers all relevant context: what it returns, how to interpret status fields, behavior under multi-user mode, and latency expectations. It leaves no significant gaps for an agent to invoke or interpret results 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?

The tool has zero parameters, and the schema properties object is empty, so there is no parameter semantics to add. Per the baseline for 0 parameters, a score of 4 is appropriate; the description cannot add meaning beyond what the schema provides because there is nothing to explain.

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 checks server health, API key configuration, and cache readiness. It distinguishes itself from sibling cache_status by explaining it confirms cache.db has finished loading and also reports server version, API key status, active plan, and integrity details.

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?

Explicit guidance is given: call at session start before detect_* or cache_status, and use after a tool-call timeout to distinguish transient cache-loading delay from permanent failure. This effectively differentiates when to use health_check versus cache_status or other tools.

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/shigechika/jquants-mcp'

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