Skip to content

Improve error messages and API consistency across MCP functions #4

@johnkferguson

Description

@johnkferguson

Several functions have inconsistent error handling that makes debugging difficult:

Issues Found

  1. search_symbols without version: Returns generic "HTTP error! status: 404" instead of indicating missing required parameter

  2. Path format confusion: get_source_code and get_type_info use different path formats:

    • get_type_info works with: "prelude/fn.use_signal.html"
    • get_source_code expects: "ser/mod.rs" (but still fails)
  3. Silent failures: get_crate_documentation returns a message but no indication of what went wrong

Suggested Improvements

  1. Better error messages:

    • "Version parameter required for search_symbols"
    • "Invalid path format, expected: ..."
    • Specific reason for documentation retrieval failures
  2. Consistent path formats:

    • Document expected path format for each function
    • Provide examples in error messages
  3. Parameter validation:

    • Validate required parameters before making HTTP requests
    • Return clear validation errors

Additional Context

This would significantly improve the developer experience when the MCP functions don't work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions