HelPHP

Call_block_action
in package
implements Tool

Tags
class

Call_block_action

Generic block-type invoker, mirroring call_module_action but pointed at a block type's own class under modules/block/{block_name}/{admin|public}/ instead of modules/{module_name}/{admin|public}/. Block type classes (Texte, Image, ...) are HelPHP_module subclasses too, but they all call prepare_module('block', true) in their constructor, which makes module_name="block" and input_action_identifier the literal string "block_action" for every one of them -- not "{block_name}_action" as call_module_action would post. This tool posts the action under that literal "block_action" key instead.

Caller-supplied "post" must use the block's own field-name convention, also module_name="block"-derived, e.g. "block_texte-id" (not "texte_texte-id") for the texte block type's id field -- use list_block_actions to discover documented fields per action.

Always treated as destructive regardless of which block/action is requested, same rationale as call_module_action: arbitrary reach over saves/deletes.

Table of Contents

Interfaces

Tool

Methods

description()  : string
Human-readable description shown to the calling LLM in tools/list.
handle()  : array<string|int, mixed>
Runs the tool.
input_schema()  : array<string|int, mixed>
JSON Schema for the tool's arguments, returned verbatim as "inputSchema" in tools/list.
is_destructive()  : bool
True if this tool mutates instance or main-repo state. Destructive tools require arguments.confirm === true on every transport, and additionally require an admin-authenticated caller on the HTTP transport (see Server::handle_tools_call).
name()  : string
MCP tool name, as advertised in tools/list and matched in tools/call.

Methods

description()

Human-readable description shown to the calling LLM in tools/list.

public description() : string

For a tool that mutates the shared main repo or an instance's live state, this description must say so explicitly.

Return values
string

handle()

Runs the tool.

public handle(array<string|int, mixed> $arguments, array<string|int, mixed> $context) : array<string|int, mixed>
Parameters
$arguments : array<string|int, mixed>

Arguments from the tools/call request.

$context : array<string|int, mixed>

['transport'=>'stdio'|'http', 'is_admin'=>bool, 'user_id'=>int|null, 'login'=>string|null]

Return values
array<string|int, mixed> —

MCP "content" array, e.g. ['content'=>[['type'=>'text','text'=>'...']]]

input_schema()

JSON Schema for the tool's arguments, returned verbatim as "inputSchema" in tools/list.

public input_schema() : array<string|int, mixed>
Return values
array<string|int, mixed>

is_destructive()

True if this tool mutates instance or main-repo state. Destructive tools require arguments.confirm === true on every transport, and additionally require an admin-authenticated caller on the HTTP transport (see Server::handle_tools_call).

public is_destructive() : bool
Return values
bool

name()

MCP tool name, as advertised in tools/list and matched in tools/call.

public name() : string
Return values
string
On this page

Search results