mcpToolFromMethod reads the (authorizer.v1.mcp_tool) option off a method descriptor. Returns nil when the option is absent or unset.
(m protoreflect.MethodDescriptor)
| 84 | // mcpToolFromMethod reads the (authorizer.v1.mcp_tool) option off a |
| 85 | // method descriptor. Returns nil when the option is absent or unset. |
| 86 | func 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. |