filterToolsByRole(tools, role)
Returns only the tools whose paths match at least one pattern in the role:matchPattern(toolPath, pattern)
Tests whether a tool path matches a glob pattern:*matches exactly one segment**matches zero or more segments
resolveAnnotations(tool)
Derives whether a tool requires user approval based on its metadata:| Source | Logic |
|---|---|
| OpenAPI | metadata.httpMethod — GET, HEAD, OPTIONS are safe |
| GraphQL | metadata.operationType — query is safe, mutation requires approval |
| MCP | metadata.mcpAnnotations.destructiveHint |
| Plugin | Falls back to tool.destructive field |