Contract validation
If a handler is missing required methods or schema definitions, the gem raises an ArgumentError on first request with a full diagnostic:
If a handler is missing required methods or schema definitions, the gem raises an ArgumentError on first request with a full diagnostic:
MyHandler does not satisfy the McpAuthorization handler contract.
Problems:
- missing instance method #call
- missing instance method #description
- missing output schema (define # @rbs type output = variant1 | variant2 | ...)
A handler class should look like:
class MyHandler
include McpAuthorization::DSL
# @rbs type output = success | error
def description
"What this tool does"
end
#: (name: String, ?force: bool @requires(:admin)) -> Hash[Symbol, untyped]
def call(name:, force: false)
# ...
end
endCollected from README.md in the repository. Edit it there, not here.