Skip to content

[Medium] API-path error messages leak internal field names instead of referencing CLI flags #171

@Nicolai1205

Description

@Nicolai1205

Summary

API validation errors are passed through verbatim to the user, exposing internal request body paths instead of the corresponding CLI flags.

Examples observed

API error message Should say
Required field 'body -> token_address' is missing Required: --token
Required field 'body -> wallet_address' is missing Required: --wallet
Value for 'body -> pagination -> per_page' is out of range --limit must be >= 1
Required field 'body -> token_symbol' is missing Required: --symbol
Invalid value for 'body -> filters' --filters must be valid JSON

Repro

# Missing --token
nansen research token info --chain solana
# → {"error":"Required field 'body -> token_address' is missing..."}

# Missing --wallet on portfolio defi
nansen research portfolio defi
# → {"error":"Required field 'body -> wallet_address' is missing..."}

# --limit 0
nansen research smart-money netflow --chain solana --limit 0
# → {"error":"Value for 'body -> pagination -> per_page' is out of the allowed range..."}

Impact

Medium. The messages are parseable but expose internal implementation details. For agent use, error messages should reference the CLI surface (--token, --wallet, --limit) not the API request shape. This makes error-driven self-correction harder for agents.

Found during

Clawfooding session on v1.10.1. Referenced in PR #167.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions