NAME

Langertha::Raider::ToolArgs - Internal check of a tool call's arguments against the tool's inputSchema

VERSION

version 0.503

DESCRIPTION

Internal module. Its interface may change without notice.

The validate step of the one execution path every tool call of a raid takes (ADR 0005): before a tool runs, its arguments are held against the inputSchema the model was shown. Only what is clearly wrong is reported -- a required key that is missing, or a top-level property whose value does not have the type the schema names. Everything JSON Schema says beyond that (enum, additionalProperties, nested schemas, anyOf, formats, ...) is not checked here: the tool itself still answers for it.

It stays lenient where Perl cannot tell or the model's slip does no harm:

  • A numeric string passes as number / integer ("5" for an integer), and a number passes as string. Perl tools coerce either way, and after any numeric use a Perl scalar no longer says which one it was.

  • 0 / 1 pass as boolean, as Perl code writes booleans. The strings "true" / "false" do not: "false" is true in Perl.

  • null for a property that is not required counts as absent.

  • No schema, a schema whose type is not object, a property without type, and a type name not listed below: nothing is checked.

tool_args_problems

my @problems = tool_args_problems($input_schema, $arguments);

Returns one message per violation, required keys first (in schema order), then property types (by name); the empty list when the arguments pass. undef arguments count as {}. Known types: string, number, integer, boolean, object, array, null, also as a list (type => [ 'string', 'null' ]).

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-raider/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.