@runloop/agent-axon-client
    Preparing search index...

    Type Alias CanUseTool

    CanUseTool: (
        toolName: string,
        input: Record<string, unknown>,
        options: {
            agentID?: string;
            blockedPath?: string;
            decisionReason?: string;
            description?: string;
            displayName?: string;
            signal: AbortSignal;
            suggestions?: PermissionUpdate[];
            title?: string;
            toolUseID: string;
        },
    ) => Promise<PermissionResult>

    Permission callback function for controlling tool usage. Called before each tool execution to determine if it should be allowed.

    Type Declaration

      • (
            toolName: string,
            input: Record<string, unknown>,
            options: {
                agentID?: string;
                blockedPath?: string;
                decisionReason?: string;
                description?: string;
                displayName?: string;
                signal: AbortSignal;
                suggestions?: PermissionUpdate[];
                title?: string;
                toolUseID: string;
            },
        ): Promise<PermissionResult>
      • Parameters

        • toolName: string
        • input: Record<string, unknown>
        • options: {
              agentID?: string;
              blockedPath?: string;
              decisionReason?: string;
              description?: string;
              displayName?: string;
              signal: AbortSignal;
              suggestions?: PermissionUpdate[];
              title?: string;
              toolUseID: string;
          }
          • OptionalagentID?: string

            If running within the context of a sub-agent, the sub-agent's ID.

          • OptionalblockedPath?: string

            The file path that triggered the permission request, if applicable. For example, when a Bash command tries to access a path outside allowed directories.

          • OptionaldecisionReason?: string

            Explains why this permission request was triggered.

          • Optionaldescription?: string

            Human-readable subtitle from the bridge (e.g. "Claude will have read and write access to files in ~/Downloads").

          • OptionaldisplayName?: string

            Short noun phrase for the tool action (e.g. "Read file"), suitable for button labels or compact UI.

          • signal: AbortSignal

            Signaled if the operation should be aborted.

          • Optionalsuggestions?: PermissionUpdate[]

            Suggestions for updating permissions so that the user will not be prompted again for this tool during this session.

            Typically if presenting the user an option 'always allow' or similar, then this full set of suggestions should be returned as the updatedPermissions in the PermissionResult.

          • Optionaltitle?: string

            Full permission prompt sentence rendered by the bridge (e.g. "Claude wants to read foo.txt"). Use this as the primary prompt text when present instead of reconstructing from toolName+input.

          • toolUseID: string

            Unique identifier for this specific tool call within the assistant message. Multiple tool calls in the same assistant message will have different toolUseIDs.

        Returns Promise<PermissionResult>