NAME

Langertha::Raider::AskTools - Internal question tool of raider: ask_user

VERSION

version 0.504

SYNOPSIS

my $ask    = Langertha::Raider::AskTools->new( answerer => sub { $have_person ? sub { my ( $question, $options ) = @_; ... } : undef } );
my $server = $ask->server;      # MCP::Server with the tool ask_user

DESCRIPTION

Internal module. Its interface may change without notice.

The ask_user tool, shaped after Claude Code's AskUserQuestion (Langertha::Raider::ToolNames): the model asks the person at the keyboard a question, with optional choices, and gets the answer as the tool result.

The tool asks nobody itself. "answerer" yields the surface's way to put the question to a person (the REPL reads a line, see "on_ask_user" in Langertha::Raider::Application). A run nobody can answer -- a one-shot raider "..." run, the Hall, a cron job, ACP -- has no such way, and the tool refuses plainly: an error result that tells the model to decide for itself and say what it assumed. It never blocks a run that no one watches.

ask_user is the tool the model sees. The self-tool raider_ask_user of Langertha::Raider (raider_mcp) is the library's own variant, which ends the raid with a question result; the application does not turn it on.

answerer

Called on every call, without arguments. Returns the code to put the question to a person -- called as $ask->($question, \@options) (@options empty without choices), returning the answer as text or undef when the person gave none -- or undef when nobody can answer. Asked per call because the surface may register its way after the tools are mounted. Without it every call is refused.

server

The MCP::Server with the tool ask_user, built once.

unavailable

The text of the refusal.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests 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.

https://raudssus.de/