Skip to main content

Install

Scope-Enforced Tools

Create Anthropic tool definitions with built-in Grantex scope enforcement:
execute() verifies the token signature and claims with verifyGrantToken() before checking its verified scp claim. The verifier may contact its configured JWKS endpoint to resolve keys, so that endpoint must be reachable. Invalid tokens and missing scopes fail before your function runs.

Tool Registry

Use GrantexToolRegistry to manage multiple tools and dispatch tool_use blocks by name:

Inspect Grant Scopes

Decode the scopes from a grant token without verification. Use this only for display or debugging; authorization decisions must use the verified tool wrapper:

Audit Logging

Wrap a tool

Handle a tool_use block directly

API Reference

createGrantexTool(options)

Returns { definition, execute }.

GrantexToolRegistry

withAuditLogging(tool, client, options)

Returns a wrapped GrantexTool that automatically logs success/failure to the audit trail on every execute() call.

handleToolCall(tool, block, client, options)

Same options as withAuditLogging. Executes the tool with block.input and logs the result.

getGrantScopes(grantToken)

Returns string[] — the scopes from the token’s scp claim.

GrantexScopeError

Thrown when a grant token is missing a required scope.

Requirements

  • Node.js 18+
  • @grantex/sdk >= 0.1.0
  • @anthropic-ai/sdk >= 0.30.0

Ownership

Grantex is owned by Orchestrum Technologies LLP. Inventor and owner: Sanjeev Kumar. Ownership contact: sanjeev@orchestrum.in or mishra.sanjeev@gmail.com.

Current Authority and Human Identity

Use the exact integration version and minimum primary SDK in Release Status. Per-invocation issuer authority and trusted principal/agent binding are opt-in. Configure the callback with the trusted issuer and derive identity from the host’s authenticated session; signature and scope checks alone do not prove current revocation or human consent. See SDK execution authority for configuration, denial behavior and manifest/decision/caps boundaries.
Last modified on September 29, 2026