Skip to content

Gateway RPC: add SDK-facing tools.invoke #74705

@BunsDev

Description

@BunsDev

Goal

Add a Gateway RPC method for SDK-facing generic tool invocation.

There is an HTTP /tools/invoke route, but @openclaw/sdk currently has oc.tools.invoke() scaffolded as unsupported. The SDK should have a clean Gateway RPC method with the same policy/approval semantics as other tool invocation paths.

Proposed method

tools.invoke

type ToolsInvokeParams = {
  name: string;
  args?: Record<string, unknown>;
  sessionKey?: string;
  agentId?: string;
  confirm?: boolean;
  idempotencyKey?: string;
};

Acceptance criteria

  • Runs through the normal Gateway tool policy pipeline.
  • Preserves plugin confirmation and approval semantics.
  • Supports session/agent scoping.
  • Returns typed refusal/approval-needed state.
  • Includes tests for interactive refusal without confirmation.
  • @openclaw/sdk can implement oc.tools.invoke() against it.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions