Skip to content

Question: How to configure Tool input parameters (like HttpClient)? #390

@willxie-eng

Description

@willxie-eng

I am seeking better understanding of how parameters are generated and passed into tools and if it's possible to customize input parameters (my scenario is I would like to set a custom handler for the HttpClient).

Using VS Code w/ GH Copilot as the MCP Client and debugging my C# MCP Server, I see that the client constructs a JSON object that represents the HttpClient, and the MCP Server deserializes this into an HttpClient object before passing it to the Tool.

{
  "httpClient": {
    "baseAddress": null,
    "defaultRequestHeaders": [],
    "defaultRequestVersion": "1.1",
    "defaultVersionPolicy": 1,
    "maxResponseContentBufferSize": 2147483647,
    "timeout": "00:01:00"
  }
}

My workaround is to not pass in the HttpClient at all and construct one inside the tool. It would be nice to have more control over this process or at least learn more about who generates the JSON (is it the LLM or MCP Client SDK or both?). TIA!

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