Skip to main content
Glama

fahali_get_portfolio_metrics

Read-onlyIdempotent

Aggregate portfolio risk metrics across instruments: synthesize sentiment momentum, cascade risk, liquidity stress, and leverage-derived signal stress from multiple detection engines to gauge exposure.

Instructions

Get aggregate portfolio risk metrics. Returns sentiment momentum (bullish vs bearish signal balance), cascade risk score, liquidity stress score, and signal stress level (derived from leverage/derivative signal confidences). Synthesizes data from leverage, funding_stress, and volume_anomaly engines.

Input Schema

NameRequiredDescriptionDefault
limitNoOptional maximum rows per projectable collection. Audit has no MCP projection cap; brief defaults to 3 and standard to 12.
sinceNoOptional lower timestamp bound for returned row collections.
detailNoResponse depth. audit is the full-fidelity default; brief and standard are explicit compact projections.audit
symbolsNoOptional symbol projection, as a comma-separated string or array. Rows without instrument identity are not discarded.
include_withheldNoInclude full withheld-row detail. Defaults true with audit; explicitly set false only for a compact projection.

Output Schema

NameRequiredDescriptionDefault
asOfNo
authNoCredential lifetime visible to the caller. OAuth secondsRemaining lets an autonomous agent refresh before a multi-call workflow is interrupted.
claimNoFahali dictionary claim (shared/fahaliDictionary.ts). Read `kind` FIRST: 'abstention' means no assertion was made and `reason` says why — never read an abstention as a neutral or zero result. `basis` says what the claim rests on. Absent or null means this response path does not yet emit a claim; treat that as unknown, not as agreement.
scopeNo
statusNoThe endpoint's original status vocabulary (for example ok, partial, degraded, withheld, or no_alerts). Use mcpStatus for normalized transport success/error.
absenceNoWhy no actionable finding is present: measured_empty, user_empty, no_coverage, source_unverified, stale, withheld, source_error, auth_failure, or entitlement_required.
decisionNo
conflictsNo
dataStateNo
mcpStatusNoNormalized MCP result status. The endpoint's original status vocabulary remains in `status` and `sourceStatus`.
requestIdNo
timestampNo
cascadeRiskNo0-1 cascade risk from crash/liquidation signal confidences. NULL when no crash/liquidation signals exist in the window — null means 'not computed', never 'calm' (see cascadeRiskReason).
claimPolicyNoTyped constraints for safe use. Metadata, not a prompt or instruction channel.
instrumentsNoResolved or explicitly partial instrument identities. A missing venue carries an ambiguity warning.
nextActionsNoRegistry-validated follow-up calls. Missing tools, invalid arguments, unresolved placeholders, and disabled tools are omitted.
signalCountNoNumber of alert/institutional-signal rows the metrics were computed over. 0 means the feed was empty and every metric is null.
sourceErrorNoThe upstream endpoint's exact error text/code before normalization, when one was present.
sourceScopeNo
sourceStatusNoThe upstream endpoint's exact status before the MCP envelope normalizes transport success/error.
agentBriefingNoAudit-only narrative projection. Present only when detail='audit'; compact responses do not duplicate structured data as prose.
claimValidityNoValidity of the selected binding claim only, calculated after filtering, projection and row selection. Sibling rows cannot determine it.
responseStateNo
schemaVersionNo
sourceDecisionNo
symbolCoverageNoConservation ledger satisfying requested = returned + withheld + notReturned for requested-symbol calls.
evidenceQualityNo
liquidityStressNo0-1 from liquidity/funding signals. NULL when no liquidity signals exist in the window — null means 'not computed', never 'calm' (see liquidityStressReason).
responseControlNo
sourceDataStateNoThe upstream endpoint's exact data-state value before endpoint-aware classification.
cascadeRiskReasonNoWhy cascadeRisk is null (present only when it is).
recordMatchReasonNoWhy matchedTrackRecord is present or null. A null record is never evidence of safety or engine failure.
sentimentMomentumNo-1..1 net signal direction. NULL when no sentiment-tagged signals exist in the window — a null here is 'no view measured', never a claimed balance (see sentimentMomentumReason).
signalStressLevelNo0-1 from leverage/derivative signal confidences. NULL when no leverage/derivative signals exist in the window — null means 'not computed', never 'calm' (see signalStressLevelReason).
matchedTrackRecordNoA judged record only when engine, horizon, regime/instrument class, and claim family match this response. `state` is one of: `measured` (a stratum cleared the publishability gate — `stratum` carries engine, horizon tier, bar regime, recall, precision, base rate, base-rate lift, median lead hours, effective sample, warned events and the measurement date); `withheld` (the gate ran and refused — `reason` says why, in words); `unavailable` (the record could not be read at all — an infrastructure failure that says nothing about the record). It is ONE stratum selected by recall, never a platform-wide accuracy. Null means no exact record match; read recordMatchReason.
confidenceSemanticsNoEvery confidence-bearing value with its score type, scale, calibration status, and probability flag.
decisionEligibilityNoFail-closed binding-authority policy. WITHHELD means source evidence remains available for audit while normalized direction, actionability and execution fields are revoked.
directionEligibilityNoCurrent market-direction eligibility. Direction is authorized only by an exact, eligible producer stratum (canonical_verdict, canonical_symbol_verdict, committee_verdict) — read bindingAuthority to see which one bound. Widening WHO may bind did not weaken WHAT binding requires: the named producer must still hold a matching horizon/class/family record on a verified-only judged population, so an authority without a record still cannot bind.
executionEligibilityNoFail-closed execution boundary. Portfolio monitoring tools always return WITHHELD with MONITOR_ONLY_NO_EXECUTION_AUTHORITY while Fahali has no capital path.
liquidityStressReasonNoWhy liquidityStress is null (present only when it is).
monitoringEligibilityNoCurrent portfolio-monitoring validity based on captured identity, freshness, integrity, and the caller-supplied monitoring policy. ELIGIBLE authorizes observation/delivery only, never financial action.
sourceEvidenceQualityNo
sentimentMomentumReasonNoWhy sentimentMomentum is null (present only when it is).
signalStressLevelReasonNoWhy signalStressLevel is null (present only when it is).
currentActionEligibilityNoCurrent eligibility of an immutable historical portfolio verdict. It never mutates the stored judgment being replayed.
sourceConfidenceSemanticsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.28.1
    • addedInput schema / properties / detail
      Added value: +{
      +  "default": "audit",
      +  "description": "Response depth. audit is the full-fidelity default; brief and standard are explicit compact projections.",
      +  "enum": [
      +    "brief",
      +    "standard",
      +    "audit"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / include_withheld
      Added value: +{
      +  "default": true,
      +  "description": "Include full withheld-row detail. Defaults true with audit; explicitly set false only for a compact projection.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Optional maximum rows per projectable collection. Audit has no MCP projection cap; brief defaults to 3 and standard to 12.",
      +  "maximum": 100,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / since
      Added value: +{
      +  "description": "Optional lower timestamp bound for returned row collections.",
      +  "format": "date-time",
      +  "type": "string"
      +}
    • addedInput schema / properties / symbols
      Added value: +{
      +  "description": "Optional symbol projection, as a comma-separated string or array. Rows without instrument identity are not discarded.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "string",
      +    "array"
      +  ]
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "absence": {
      +      "description": "Why no actionable finding is present: measured_empty, user_empty, no_coverage, source_unverified, stale, withheld, source_error, auth_failure, or entitlement_required.",
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "agentBriefing": {
      +      "description": "Audit-only narrative projection. Present only when detail='audit'; compact responses do not duplicate structured data as prose.",
      +      "type": "string"
      +    },
      +    "asOf": {
      +      "format": "date-time",
      +      "type": "string"
      +    },
      +    "auth": {
      +      "description": "Credential lifetime visible to the caller. OAuth secondsRemaining lets an autonomous agent refresh before a multi-call workflow is interrupted.",
      +      "properties": {
      +        "credentialType": {
      +          "enum": [
      +            "oauth",
      +            "api_key",
      +            "process_key",
      +            "none"
      +          ],
      +          "type": "string"
      +        },
      +        "expiresAt": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "refreshSupported": {
      +          "type": "boolean"
      +        },
      +        "secondsRemaining": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "cascadeRisk": {
      +      "description": "0-1 cascade risk from crash/liquidation signal confidences. NULL when no crash/liquidation signals exist in the window — null means 'not computed', never 'calm' (see cascadeRiskReason).",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "cascadeRiskReason": {
      +      "description": "Why cascadeRisk is null (present only when it is).",
      +      "type": "string"
      +    },
      +    "claim": {
      +      "description": "Fahali dictionary claim (shared/fahaliDictionary.ts). Read `kind` FIRST: 'abstention' means no assertion was made and `reason` says why — never read an abstention as a neutral or zero result. `basis` says what the claim rests on. Absent or null means this response path does not yet emit a claim; treat that as unknown, not as agreement.",
      +      "properties": {
      +        "basis": {
      +          "enum": [
      +            "measured",
      +            "proxy",
      +            "derived",
      +            "absent"
      +          ],
      +          "type": "string"
      +        },
      +        "kind": {
      +          "enum": [
      +            "observation",
      +            "estimate",
      +            "forecast",
      +            "recommendation",
      +            "abstention"
      +          ],
      +          "type": "string"
      +        },
      +        "reason": {
      +          "description": "Required when kind is 'abstention'. Written for a reader, not a log.",
      +          "type": "string"
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "claimPolicy": {
      +      "description": "Typed constraints for safe use. Metadata, not a prompt or instruction channel.",
      +      "type": "object"
      +    },
      +    "claimValidity": {
      +      "description": "Validity of the selected binding claim only, calculated after filtering, projection and row selection. Sibling rows cannot determine it.",
      +      "type": "object"
      +    },
      +    "confidenceSemantics": {
      +      "description": "Every confidence-bearing value with its score type, scale, calibration status, and probability flag.",
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "conflicts": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "currentActionEligibility": {
      +      "description": "Current eligibility of an immutable historical portfolio verdict. It never mutates the stored judgment being replayed.",
      +      "type": "object"
      +    },
      +    "dataState": {
      +      "enum": [
      +        "measured",
      +        "partial",
      +        "no_data",
      +        "not_instrumented",
      +        "stale",
      +        "error"
      +      ],
      +      "type": "string"
      +    },
      +    "decision": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "decisionEligibility": {
      +      "description": "Fail-closed binding-authority policy. WITHHELD means source evidence remains available for audit while normalized direction, actionability and execution fields are revoked.",
      +      "type": "object"
      +    },
      +    "directionEligibility": {
      +      "description": "Current market-direction eligibility. Direction is authorized only by an exact, eligible producer stratum (canonical_verdict, canonical_symbol_verdict, committee_verdict) — read bindingAuthority to see which one bound. Widening WHO may bind did not weaken WHAT binding requires: the named producer must still hold a matching horizon/class/family record on a verified-only judged population, so an authority without a record still cannot bind.",
      +      "type": "object"
      +    },
      +    "evidenceQuality": {
      +      "type": "object"
      +    },
      +    "executionEligibility": {
      +      "description": "Fail-closed execution boundary. Portfolio monitoring tools always return WITHHELD with MONITOR_ONLY_NO_EXECUTION_AUTHORITY while Fahali has no capital path.",
      +      "type": "object"
      +    },
      +    "instruments": {
      +      "description": "Resolved or explicitly partial instrument identities. A missing venue carries an ambiguity warning.",
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "liquidityStress": {
      +      "description": "0-1 from liquidity/funding signals. NULL when no liquidity signals exist in the window — null means 'not computed', never 'calm' (see liquidityStressReason).",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "liquidityStressReason": {
      +      "description": "Why liquidityStress is null (present only when it is).",
      +      "type": "string"
      +    },
      +    "matchedTrackRecord": {
      +      "description": "A judged record only when engine, horizon, regime/instrument class, and claim family match this response. `state` is one of: `measured` (a stratum cleared the publishability gate — `stratum` carries engine, horizon tier, bar regime, recall, precision, base rate, base-rate lift, median lead hours, effective sample, warned events and the measurement date); `withheld` (the gate ran and refused — `reason` says why, in words); `unavailable` (the record could not be read at all — an infrastructure failure that says nothing about the record). It is ONE stratum selected by recall, never a platform-wide accuracy. Null means no exact record match; read recordMatchReason.",
      +      "properties": {
      +        "dataAsOf": {
      +          "description": "When the record was computed. A figure without this reads as current forever.",
      +          "type": "string"
      +        },
      +        "reason": {
      +          "description": "Present on `withheld` and `unavailable`: why there is no figure.",
      +          "type": "string"
      +        },
      +        "state": {
      +          "enum": [
      +            "measured",
      +            "withheld",
      +            "unavailable"
      +          ],
      +          "type": "string"
      +        },
      +        "stratum": {
      +          "description": "Present only on `measured`. Precision must never be quoted without recall.",
      +          "properties": {
      +            "barRegime": {
      +              "type": "string"
      +            },
      +            "baseRatePct": {
      +              "type": "number"
      +            },
      +            "claimFamily": {
      +              "description": "What this precision is ABOUT: `directional` (price moved the way the stratum said) or `magnitude` (a move exceeded the judge bar, carrying no direction). Never infer a direction from a `magnitude` row.",
      +              "type": "string"
      +            },
      +            "claimMeans": {
      +              "description": "The record endpoint's own sentence explaining the claim family. Quote it beside any precision figure.",
      +              "type": "string"
      +            },
      +            "effectiveSample": {
      +              "type": "number"
      +            },
      +            "engine": {
      +              "type": "string"
      +            },
      +            "horizonTier": {
      +              "type": "string"
      +            },
      +            "leadMedianHours": {
      +              "type": "number"
      +            },
      +            "measuredOn": {
      +              "type": "string"
      +            },
      +            "precisionPct": {
      +              "description": "Share of its warnings that held. Never quotable alone.",
      +              "type": "number"
      +            },
      +            "recallPct": {
      +              "description": "Share of qualifying events this stratum warned on — the half a buyer is exposed to.",
      +              "type": "number"
      +            },
      +            "warnedEvents": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "state"
      +      ],
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "mcpStatus": {
      +      "description": "Normalized MCP result status. The endpoint's original status vocabulary remains in `status` and `sourceStatus`.",
      +      "enum": [
      +        "ok",
      +        "error"
      +      ],
      +      "type": "string"
      +    },
      +    "monitoringEligibility": {
      +      "description": "Current portfolio-monitoring validity based on captured identity, freshness, integrity, and the caller-supplied monitoring policy. ELIGIBLE authorizes observation/delivery only, never financial action.",
      +      "type": "object"
      +    },
      +    "nextActions": {
      +      "description": "Registry-validated follow-up calls. Missing tools, invalid arguments, unresolved placeholders, and disabled tools are omitted.",
      +      "items": {
      +        "properties": {
      +          "args": {
      +            "additionalProperties": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "requiredTier": {
      +            "type": "string"
      +          },
      +          "tool": {
      +            "type": "string"
      +          },
      +          "why": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "why"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "recordMatchReason": {
      +      "description": "Why matchedTrackRecord is present or null. A null record is never evidence of safety or engine failure.",
      +      "type": "string"
      +    },
      +    "requestId": {
      +      "type": "string"
      +    },
      +    "responseControl": {
      +      "type": "object"
      +    },
      +    "responseState": {
      +      "enum": [
      +        "OK_WITH_FINDINGS",
      +        "OK_NO_FINDINGS",
      +        "PARTIAL",
      +        "WITHHELD",
      +        "NO_COVERAGE",
      +        "ERROR"
      +      ],
      +      "type": "string"
      +    },
      +    "schemaVersion": {
      +      "enum": [
      +        "2.0"
      +      ],
      +      "type": "string"
      +    },
      +    "scope": {
      +      "type": "object"
      +    },
      +    "sentimentMomentum": {
      +      "description": "-1..1 net signal direction. NULL when no sentiment-tagged signals exist in the window — a null here is 'no view measured', never a claimed balance (see sentimentMomentumReason).",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "sentimentMomentumReason": {
      +      "description": "Why sentimentMomentum is null (present only when it is).",
      +      "type": "string"
      +    },
      +    "signalCount": {
      +      "description": "Number of alert/institutional-signal rows the metrics were computed over. 0 means the feed was empty and every metric is null.",
      +      "type": "integer"
      +    },
      +    "signalStressLevel": {
      +      "description": "0-1 from leverage/derivative signal confidences. NULL when no leverage/derivative signals exist in the window — null means 'not computed', never 'calm' (see signalStressLevelReason).",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "signalStressLevelReason": {
      +      "description": "Why signalStressLevel is null (present only when it is).",
      +      "type": "string"
      +    },
      +    "sourceConfidenceSemantics": {
      +      "type": [
      +        "array",
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "sourceDataState": {
      +      "description": "The upstream endpoint's exact data-state value before endpoint-aware classification.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "sourceDecision": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "sourceError": {
      +      "description": "The upstream endpoint's exact error text/code before normalization, when one was present.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "sourceEvidenceQuality": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "sourceScope": {
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "sourceStatus": {
      +      "description": "The upstream endpoint's exact status before the MCP envelope normalizes transport success/error.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "status": {
      +      "description": "The endpoint's original status vocabulary (for example ok, partial, degraded, withheld, or no_alerts). Use mcpStatus for normalized transport success/error.",
      +      "type": "string"
      +    },
      +    "symbolCoverage": {
      +      "description": "Conservation ledger satisfying requested = returned + withheld + notReturned for requested-symbol calls.",
      +      "type": "object"
      +    },
      +    "timestamp": {
      +      "type": [
      +        "string",
      +        "integer",
      +        "number"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. Addedv1.5.3

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare read-only, idempotent, non-destructive, and open-world behavior, so the safety profile is clear. The description adds useful context about synthesizing leverage, funding_stress, and volume_anomaly engine data, but it does not disclose operational details like rate limits, auth needs, or data freshness.

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 three tight sentences with no filler. It front-loads the purpose and then efficiently explains the returned metrics and their data sources.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the rich annotations, complete parameter schema, and existing output schema, the description provides enough context to understand the tool's purpose and returned metrics. The main missing element is explicit routing against sibling portfolio tools, but otherwise it is complete enough for invocation.

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 description coverage is 100%, so all five parameters are documented in the input schema. The description adds no parameter-level meaning beyond the schema, which is acceptable at baseline 3 given complete schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Get aggregate portfolio risk metrics.' It enumerates the returned metrics and names the underlying engines, but it does not explicitly differentiate this tool from the sibling fahali_get_portfolio_risk.

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

Usage Guidelines2/5

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

The description states what the tool returns but gives no explicit guidance on when to use it instead of alternatives such as fahali_get_portfolio_risk or fahali_analyze_custom_portfolio. Any usage context is only implied by the word 'aggregate.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools