fix(mcp): analyze_bandar lists the tiers top accepts

The schema said uint8 0-255; only 1, 3, 5 and 10 are valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh
This commit is contained in:
hermes 2026-10-18 11:48:00 +00:00
commit 6f211a398f
3 changed files with 14 additions and 8 deletions

View file

@ -1,6 +1,7 @@
//! Tool inputs. String enums are validated by idx-core's `FromStr`, so the
//! accepted values and error messages match the CLI; the schemas list them.
use idx_core::analysis::bandar::TIERS;
use idx_core::api::types::{Interval, Period};
use idx_core::broker::types::{BrokerBoard, BrokerInvestor};
use idx_core::flow::types::FlowSource;
@ -155,6 +156,7 @@ pub struct BandarParams {
pub scope: BrokerScope,
/// Tier behind the headline signal: 1, 3, 5 or 10 brokers per side (default 5).
#[serde(default)]
#[schemars(schema_with = "top_schema")]
pub top: Option<u8>,
}
@ -255,3 +257,7 @@ fn board_schema(_: &mut SchemaGenerator) -> Schema {
fn flow_source_schema(_: &mut SchemaGenerator) -> Schema {
string_enum(FlowSource::ALL.map(FlowSource::as_str).to_vec())
}
fn top_schema(_: &mut SchemaGenerator) -> Schema {
json_schema!({ "type": "integer", "enum": TIERS })
}

View file

@ -59,13 +59,13 @@
"top": {
"default": null,
"description": "Tier behind the headline signal: 1, 3, 5 or 10 brokers per side (default 5).",
"format": "uint8",
"maximum": 255,
"minimum": 0,
"type": [
"integer",
"null"
]
"enum": [
1,
3,
5,
10
],
"type": "integer"
}
},
"required": [