Skip to content

Per-tool timeout overrides #1687

@dgenio

Description

@dgenio

Description

Context

#1685 implemented server-wide tool execution timeouts with a default of 300 seconds.

Motivation

Some tools may need different timeout values:

  • Quick lookups: get_weather() - 10 seconds
  • Heavy processing: analyze_dataset() - 20 minutes

Proposed API

# Server default
mcp = FastMCP("MyServer", tool_timeout_seconds=300)

# Per-tool override
@mcp.tool(timeout_seconds=1200)  # 20 minutes
async def analyze_large_dataset(data: str) -> dict:
    ...

Questions

  • Is this needed in practice, or is the server-wide timeout sufficient?
  • Should None mean "use server default" or "no timeout"?
  • Should this be per-tool or per-call?

Non-Goals (for this issue)

  • Client-side timeout control (separate concern)
  • Retry policies (separate concern)

References

No response

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