Skip to main content
Toolshed uses role-based access control to filter which tools a user can see and invoke. Each role defines a set of glob patterns that match tool paths.

Role schema

Pattern syntax

Patterns match against dot-separated tool paths:
  • * matches exactly one segment
  • ** matches zero or more segments at any depth

Example roles

Developer — full GitHub access, read-only Slack:
Admin — access to everything:
Read-only — only list and read operations:

How filtering works

The policy engine provides two functions from @toolshed/policy:

filterToolsByRole(tools, role)

Returns only the tools whose paths match at least one pattern in the role:

matchPattern(toolPath, pattern)

Tests whether a single tool path matches a single pattern:

Annotation resolution

The policy package also resolves whether a tool requires approval:
Resolution priority (first match wins):
  1. OpenAPI tools: metadata.httpMethod — GET, HEAD, OPTIONS are safe
  2. GraphQL tools: metadata.operationType — queries are safe, mutations require approval
  3. MCP tools: metadata.mcpAnnotations.destructiveHint
  4. Plugin tools: falls back to the explicit destructive flag