fix: parse MCP result payloads and drop place idempotency_key

Typed result structs replace empty envelopes. Equity place sends
ref_id only so live additionalProperties:false schemas accept the call.
This commit is contained in:
2026-09-01 14:18:39 -05:00
parent f52a19181d
commit a6bf8632ce
22 changed files with 2225 additions and 74 deletions
+46 -7
View File
@@ -42,14 +42,29 @@ type Column struct {
// FilterSpecsRequest is the argument set for get_scanner_filter_specs (none).
type FilterSpecsRequest struct{}
// FilterSpec is one filter type from get_scanner_filter_specs.
type FilterSpec struct {
FilterType string `json:"filter_type"`
Name string `json:"name"`
}
// FilterSpecsResult is the parsed get_scanner_filter_specs payload.
type FilterSpecsResult struct{}
type FilterSpecsResult struct {
Specs []FilterSpec
}
// DatapointsRequest is the argument set for get_scanner_datapoints (none).
type DatapointsRequest struct{}
// Datapoint is one expression token from get_scanner_datapoints.
type Datapoint struct {
Name string `json:"name"`
}
// DatapointsResult is the parsed get_scanner_datapoints payload.
type DatapointsResult struct{}
type DatapointsResult struct {
Datapoints []Datapoint
}
// ScansRequest is the argument set for get_scans (none).
type ScansRequest struct{}
@@ -74,8 +89,24 @@ type CreateRequest struct {
Title string
}
// ScanResult is a saved scan plus optional live rows.
type ScanResult struct {
ID string
Title string
Rows []ScanRow
Total int
}
// ScanRow is one live scanner match.
type ScanRow struct {
Symbol string
InstrumentID string
}
// CreateResult is the parsed create_scan payload.
type CreateResult struct{}
type CreateResult struct {
ScanResult
}
// PreviewRequest is the argument set for preview_scan.
type PreviewRequest struct {
@@ -84,7 +115,9 @@ type PreviewRequest struct {
}
// PreviewResult is the parsed preview_scan payload.
type PreviewResult struct{}
type PreviewResult struct {
ScanResult
}
// RunRequest is the argument set for run_scan.
type RunRequest struct {
@@ -92,7 +125,9 @@ type RunRequest struct {
}
// RunResult is the parsed run_scan payload.
type RunResult struct{}
type RunResult struct {
ScanResult
}
// UpdateFiltersRequest is the argument set for update_scan_filters.
type UpdateFiltersRequest struct {
@@ -101,7 +136,9 @@ type UpdateFiltersRequest struct {
}
// UpdateFiltersResult is the parsed update_scan_filters payload.
type UpdateFiltersResult struct{}
type UpdateFiltersResult struct {
ScanResult
}
// UpdateConfigRequest is the argument set for update_scan_config.
type UpdateConfigRequest struct {
@@ -112,7 +149,9 @@ type UpdateConfigRequest struct {
}
// UpdateConfigResult is the parsed update_scan_config payload.
type UpdateConfigResult struct{}
type UpdateConfigResult struct {
ScanResult
}
// FilterSpecs calls get_scanner_filter_specs.
func (c *Client) FilterSpecs(ctx context.Context, req FilterSpecsRequest) (FilterSpecsResult, error) {