Skip to main content
Glama

apex_generate_ajax_handler

Generate a server-side PL/SQL AJAX callback for Oracle APEX, callable from client-side JavaScript. Automatically adds the JS caller function to the page for immediate use.

Instructions

Create an AJAX callback process (PL/SQL) callable from client-side JS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idYesPage that owns this callback.
plsql_codeYesPL/SQL block that runs server-side. Access page items via bind variables: :P10_ITEM_NAME Return JSON via: apex_json.open_object; apex_json.write('key', val); apex_json.close_object; Example: DECLARE v_count NUMBER; BEGIN SELECT COUNT(*) INTO v_count FROM my_table WHERE status = :P10_STATUS; apex_json.open_object; apex_json.write('count', v_count); apex_json.write('status', 'success'); apex_json.close_object; END;
auto_add_jsNoAutomatically add the generated JavaScript caller function to the page via apex_add_page_js() (default True). When True, the function will be available at runtime without any additional steps. Set to False if you want to manually review and modify the JS before adding it to the page.
input_itemsNoList of page item names to send to server (e.g., ["P10_SEARCH", "P10_STATUS"]).
return_jsonNoWhether the callback returns JSON (default True).
callback_nameYesUPPERCASE name for the callback (e.g., "SAVE_RECORD", "SEARCH_DATA"). Called from JS as: apex.server.process('CALLBACK_NAME', {...})

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations are all false, providing no useful safety profile. The description only says 'Create', which implies a write operation but does not disclose side effects like page modification, potential overwrites, or the need for existing page objects. The schema's auto_add_js description adds such context, but the tool description itself is minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the action and outcome. No wasted words; it is appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Although the tool has six parameters and side effects, the schema covers parameter details and an output schema exists. The description alone does not explain the workflow or prerequisites (e.g., page must exist), but the schema compensates enough to make the tool minimally usable. Basic context is present, but richer integration guidance would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the schema itself provides detailed parameter descriptions, including a full PL/SQL example for plsql_code. The tool description adds no additional parameter semantics, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Create') and a clear resource ('AJAX callback process (PL/SQL)') with an explicit purpose ('callable from client-side JS'). This clearly distinguishes it from sibling tools like apex_add_process or apex_generate_rest_endpoints.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites. While the name implies its use case, there is no explicit 'use this when...' or comparison with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TechFernandesLTDA/apex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server