get_custom_codeAdmin-only MCP tool.
Read the custom PHP code attached to a form or to an application.
Formulize runs custom code at certain moments: when an entry is about to be saved, after it has been saved, when it is deleted, and when it is deciding whether someone may edit an entry. An application can also hold a library of shared code that is available in every request. None of this is visible in a form’s elements; the get_form_details tool only reports which pieces of custom code exist in a form. The list_applications tool only reports which applications have custom code libraries. This tool will show you the actual code.
Read the code before changing it. The tools that write it - update_form_code for a form’s procedures, and update_application_code for an application’s shared library - each replace the code entirely rather than adding to it.
| Property | Type | Required? | Description |
|---|---|---|---|
| code_type | string (one of: form_on_before_save, form_on_after_save, form_on_delete, form_custom_edit_check, application_code) | Optional | Optional. Which piece of code. The four ‘form_’ types belong to a single form and need form_id. ‘application_code’ belongs to an application and needs application_id. Leave this out to get every piece of code for whichever id you supply. |
| form_id | integer | Optional | Required when code_type is one of the ‘form_’ types. The id of the form the code belongs to. |
| application_id | integer | Optional | Required when code_type is ‘application_code’. The id of the application. Use the list_applications tool to find application ids. |