fastmcp icon indicating copy to clipboard operation
fastmcp copied to clipboard

I've found that currently, the FastMCP framework is unable to write the descriptions of the parameters. Could you please provide support for this?

Open TimothyDing opened this issue 8 months ago • 1 comments

I've found that currently, the FastMCP framework is unable to write the descriptions of the parameters. Could you please provide support for this?

TimothyDing avatar Apr 19 '25 04:04 TimothyDing

If you use pedantic models for the parameters the descriptions will be in the schema.


class FunctionParams(BaseModel):
   arg1 = Field(description="cool description")

def function(args: FunctionParams):
   pass

Also normally the doctoring for your tool will be included with the schema and so you can document the parameters in the doctoring

def function(arg1, arg2):
"""
This function does something 

args:
    arg1: this arg does something
    arg2: this arg does something else
"""

strawgate avatar Apr 21 '25 23:04 strawgate

I believe what @strawgate says is correct, if there's a specific case that isn't working please open an issue with an MRE!

jlowin avatar Apr 23 '25 19:04 jlowin