listFunctions
List user-defined SQL functions on MySQL, MariaDB, or PostgreSQL, with name search and optional details
List user-defined SQL functions in a database. PostgreSQL excludes aggregates, window functions, and procedures; MySQL/MariaDB excludes loadable UDFs registered in mysql.func. Results are paginated — see Cursor Pagination for the protocol. The database parameter selects which database to inspect and defaults to the active database. PostgreSQL restricts the listing to the public schema. Available on MySQL/MariaDB and PostgreSQL only — not available for SQLite.
The tool accepts these optional parameters:
cursor— opaque pagination token; pass back the prior response'snextCursorto fetch the next page.search— a case-insensitive substring filter on function name:calcmatchescalc,calc_total, andrecalc. The value is wrapped as%calc%in aLIKE/ILIKEpattern, so%and_inside it still act as wildcards (_matches any single character). Thesearchvalue must remain identical across paginated calls for cursor continuity.detailed— whentrue, the response includes per-function metadata (language, arguments, return type, fullCREATE FUNCTIONtext, and backend-specific extras) so a single call enumerates functions and inspects them. Defaults tofalse.
In brief mode (default) the response is a sorted JSON array of function-name strings. PostgreSQL overloads appear as one entry per overload — duplicate name strings are expected:
{
"entries": ["calc_order_subtotal", "calc_order_total", "calc_order_total"]
}In detailed mode the response is keyed by function signature. The PostgreSQL payload disambiguates overloads via name(arguments):
{
"entries": {
"calc_order_total(order_id integer, tax_rate numeric)": {
"schema": "public",
"name": "calc_order_total",
"language": "sql",
"arguments": "order_id integer, tax_rate numeric",
"returnType": "numeric",
"volatility": "IMMUTABLE",
"strict": true,
"security": "INVOKER",
"parallelSafety": "SAFE",
"owner": "app_user",
"description": "Sums line items minus discounts",
"definition": "CREATE OR REPLACE FUNCTION public.calc_order_total(order_id integer, tax_rate numeric) RETURNS numeric ..."
}
}
}The detailed-mode field set diverges per backend:
- PostgreSQL — keyed by
name(arguments)(overloads disambiguate). Each value carriesschema,name,language,arguments,returnType,volatility(IMMUTABLE/STABLE/VOLATILE),strict,security(INVOKER/DEFINER),parallelSafety(SAFE/RESTRICTED/UNSAFE),owner,description(ornullwhen noCOMMENT ON FUNCTION), anddefinition(the fullpg_get_functiondefoutput). Brief and detailed pages share the same(proname, oid)row order, so a client can switchdetailedmid-pagination without losing position. - MySQL / MariaDB — keyed by bare function name (the engines do not allow function overloading). Each value carries
schema,language(typically"SQL"; MariaDB external-language functions report the external language name),arguments(comma-separatedname typepairs frominformation_schema.PARAMETERS, empty string for zero-parameter functions),returnType(fullDTD_IDENTIFIERincluding length/precision/unsigned/enum/set members),deterministic(boolean),sqlDataAccess(CONTAINS_SQL/NO_SQL/READS_SQL_DATA/MODIFIES_SQL_DATA),security(INVOKER/DEFINER),definer(user@host),description(ornullwhen noCOMMENT),definition(canonical reconstructedCREATE FUNCTIONtext includingDEFINER=in`user`@`host`form), plus the session context active at function-creation time:sqlMode,characterSetClient,collationConnection,databaseCollation.volatility,parallelSafety, andstrictare absent — no MySQL/MariaDB analogues.owneris renamed todefinerto match the engine's terminology.