Output schemas not documented in source code. No return type definitions visible for any of the 38 tools, preventing LLMs from planning downstream tool calls or extracting field data reliably.
'format' parameter in 10+ tools accepts free-form string values (minimal, compact, full, raw) without enum constraints. LLMs will hallucinate unsupported format values. Should be constrained enum.
Recommendations
Add JSON Schema output definitions to every tool. Especially critical for list-returning tools (spotify_search_music, spotify_get_saved_tracks, etc.). Document return type as: {"type": "object", "properties": {"items": [...], "total": "integer", "offset": "integer"}}
Convert all free-form string parameters to enums. For 'format', use: {"type": "string", "enum": ["minimal", "compact", "full", "raw"]}. For 'time_range', use: {"enum": ["short_term", "medium_term", "long_term"]}. For 'state' in repeat/shuffle, enumerate valid values.
Add min/max constraints to pagination params. Example: {"limit": {"type": "integer", "minimum": 1, "maximum": 50}, "offset": {"type": "integer", "minimum": 0}}. Document in descriptions: 'Maximum tracks to return (1-50)'.
Document idempotency for write operations. For spotify_save_tracks, add: 'Idempotent: saving the same tracks multiple times is safe and will not create duplicates.' For spotify_add_tracks_to_playlist, clarify whether duplicates are allowed.
Add error recovery guidance to all write operations. Example for spotify_create_playlist: 'If name is already taken, the Spotify API will return error 400. Search existing playlists with spotify_get_user_playlists() and select a unique name.'
Mark destructive operations in descriptions. For spotify_remove_saved_tracks: 'WARNING: This action is irreversible. Use with caution. Consider calling spotify_get_saved_tracks() first to confirm the tracks you want to remove.'
Document permission/scope requirements in descriptions. E.g., spotify_save_tracks should note: 'Requires user-library-modify scope.' This enables scope validation.
No error handling guidance in tool descriptions. None of the 38 tools document what to do when a call fails (e.g., 'User not found. Try search_users() first.'). Agents have no recovery path when errors occur.
Destructive operations (spotify_remove_saved_tracks, spotify_remove_tracks_from_playlist, spotify_unfollow_playlist, spotify_pause_playback, spotify_set_volume) lack dry-run or confirmation hints. No indication in descriptions that these are irreversible or require confirmation.
Parameter 'time_range' in spotify_get_top_items accepts free-form string (short_term, medium_term, long_term) without enum constraint. Should be enum to prevent hallucinated values.
Parameter 'type' in spotify_get_top_items and 'include_groups' in spotify_get_artist_albums use free-form strings without enum constraints. Ambiguous naming + no enum = LLM hallucination risk.
Pagination parameters (limit, offset, after, before) lack documented constraints. No min/max values specified in descriptions. LLMs may pass invalid values like limit=1000 or negative offsets.
Idempotency not documented for write operations. Tools like spotify_save_tracks, spotify_follow_artists, and spotify_add_tracks_to_playlist do not indicate whether repeated calls are safe or cause duplicates.
For multi-ID parameters (track_ids, artist_ids), document max count explicitly. E.g., 'Comma-separated Spotify track IDs (max 50). Providing more than 50 will fail with error 400.'
Add parameter relationships documentation. For spotify_start_playback, note: 'Provide either context_uri OR track_uris, not both. If both are provided, context_uri takes precedence.'
Document cursor/pagination token format. For spotify_get_followed_artists 'after' param, clarify: 'After cursor is returned from a previous call. Omit on first call. Pagination tokens are opaque strings, do not modify.'
Validate and document market/country code format. Specify: 'ISO 3166-1 alpha-2 country code (e.g., US, GB, DE). Invalid codes return 400 error.' This prevents hallucinated values like 'country_code' or 'united_states'.