@opscogs/octools
    Preparing search index...

    Function toAnthropicTool

    • Return tool as an Anthropic Messages API tools[] entry.

      The entry carries name (with namePrefix prepended, checked against ANTHROPIC_NAME_RE), description and input_schema. The schema is the descriptor's with every title and x- key stripped and additionalProperties: false on the root unless it sets its own, so the runtime can set strict: true itself. Dropped, because the API has no slot for them: title, outputSchema, the hints, access / target, resultKind, deprecated, meta and tags (the runtime's registry keeps those, and selectTools filters by tag first). strict is not emitted; it is a runtime choice. Throws OCToolError when the prefixed name breaks the rule.

      Parameters

      Returns Record<string, unknown>