MCPcopy
hub / github.com/modelcontextprotocol/python-sdk / decorator

Method decorator

src/mcp/server/mcpserver/server.py:558–569  ·  view source on GitHub ↗
(fn: _CallableT)

Source from the content-addressed store, hash-verified

556 )
557
558 def decorator(fn: _CallableT) -> _CallableT:
559 self.add_tool(
560 fn,
561 name=name,
562 title=title,
563 description=description,
564 annotations=annotations,
565 icons=icons,
566 meta=meta,
567 structured_output=structured_output,
568 )
569 return fn
570
571 return decorator
572

Callers

nothing calls this directly

Calls 7

add_toolMethod · 0.95
add_resourceMethod · 0.95
add_promptMethod · 0.95
find_context_parameterFunction · 0.90
add_request_handlerMethod · 0.80
add_templateMethod · 0.80
from_functionMethod · 0.45

Tested by

no test coverage detected