MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / mcpToolFromMethod

Function mcpToolFromMethod

internal/mcp/scanner.go:86–96  ·  view source on GitHub ↗

mcpToolFromMethod reads the (authorizer.v1.mcp_tool) option off a method descriptor. Returns nil when the option is absent or unset.

(m protoreflect.MethodDescriptor)

Source from the content-addressed store, hash-verified

84// mcpToolFromMethod reads the (authorizer.v1.mcp_tool) option off a
85// method descriptor. Returns nil when the option is absent or unset.
86func mcpToolFromMethod(m protoreflect.MethodDescriptor) *authorizerv1.McpTool {
87 opts := m.Options()
88 if opts == nil {
89 return nil
90 }
91 t, ok := proto.GetExtension(opts, authorizerv1.E_McpTool).(*authorizerv1.McpTool)
92 if !ok || t == nil {
93 return nil
94 }
95 return t
96}
97
98// camelToSnake converts MixedCase / camelCase to snake_case. ASCII only;
99// proto method names never contain non-ASCII.

Callers 1

ScanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected