Skip to content

tool macro expands to serde_json without re-export #487

Closed

Description

@jonaro00

Describe the bug
tool macro expands to serde_json here which causes compilation error in crates that don't have it as a dependency.

To Reproduce
Steps to reproduce the behavior:

  1. cargo new asdf
  2. cd asdf
  3. cargo add rcmp -F macros
  4. add basic tool call to src/main.rs
struct A;

#[rmcp::tool_router]
impl A {
    #[rmcp::tool]
    async fn foo() {}
}
  1. error[E0433]: failed to resolve: use of unresolved module or unlinked crate serde_json

Proposed solution
Other location in the macro already assumes the downstream crate depends on rmcp, so expanding the macro to use the re-exported ::rmcp::serde_json::... should work.

Activity

  1. added
    bugSomething is not working
    P1High: significant functionality gap or spec violation
    ready for workIssue is well-defined and ready to be picked up
    on Feb 26, 2026
  2. alexhancock commented on Feb 27, 2026

    @alexhancock
    Contributor

    @jonaro00 would you have time to submit a PR for the proposed solution?

  3. kakarot-dev commented on Mar 9, 2026

    @kakarot-dev
    Contributor

    @alexhancock i have submitted a pr for this! Please check #735
    Thank you!

  4. added a commit that references this issue on Mar 9, 2026
    be24898
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High: significant functionality gap or spec violationT-macrosMacro changesbugSomething is not workingready for workIssue is well-defined and ready to be picked up

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions