update_custom_hook
[MAINTENANCE] b4f4627f — the previously-missing generic enable/disable/edit path for a user-defined hook (id returned by add_custom_hook / get_custom_hooks): patches name, event, matcher, script_sh, script_ps1, blocking, and/or enabled without the delete+recreate round-trip add_custom_hook/delete...
This record as markdown: /tools/io-github-ajc3xc-meridian/update-custom-hook.md
What update_custom_hook does on Meridian
AI agents use update_custom_hook to create or update resources in Meridian, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Meridian environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | — | New human-readable name; re-derives the slug (must not be 'sprint_guard' or collide with another hook's slug on this project). |
event | string | — | New hook event. |
enabled | boolean | — | Enable/disable this hook. Disabling immediately removes any already-written artifact files for it (best-effort). |
hook_id | string | Yes | The hook id to update. |
matcher | string | — | New Claude Code tool-name matcher regex; ignored for Stop hooks. |
blocking | boolean | — | true = real exit-code-blocking semantics. false = advisory/non-blocking. |
script_sh | string | — | New POSIX shell script body. |
project_id | string | — | |
script_ps1 | string | — | New PowerShell script body. |
project_name | string | — | Project name — an alternative to project_id; resolved to the id internally. project_id wins if both are given. |
Parameters from the server's own tool schema.
Why update_custom_hook is rated Medium
An AI agent can call update_custom_hook faster than any human can review: one bad instruction and it creates or modifies resources in Meridian by the hundred, each call as confident as the last.
Risk signalsHigh parameter count (10 properties)
Attacks that exploit this kind of access
The rule that runs update_custom_hook safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Meridian, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For update_custom_hook, this is the rule to start with:
update_custom_hook stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Meridian, apply this rule, and every update_custom_hook call is checked against it from then on.
Questions about update_custom_hook
[MAINTENANCE] b4f4627f — the previously-missing generic enable/disable/edit path for a user-defined hook (id returned by add_custom_hook / get_custom_hooks): patches name, event, matcher, script_sh, script_ps1, blocking, and/or enabled without the delete+recreate round-trip add_custom_hook/delete_custom_hook would otherwise require. At least one editable field is required. Renaming re-derives the slug (same reserved-name / uniqueness checks as add_custom_hook); the db layer raises ValueError for a bad event, the reserved 'sprint_guard' name, or a slug collision — surfaced as {error}. Returns {error} (never raises) when hook_id doesn't resolve for this project. Flipping enabled true -> false also removes any already-written .claude/hooks/<slug>.* files immediately (best-effort, when the project has a resolvable repo_path) instead of waiting for the next generate_handoff to simply stop re-writing them — reported back as removed_files when any were deleted. Persistent-state disclosure: on hosted Meridian, supplied text and project/session metadata are sent to and stored in Meridian's service; self-hosted deployments keep them in the configured local SQLite/Postgres database. This data is visible in the dashboard/API and later project context or handoffs. Delete individual tasks, notes, or decisions where supported, or delete the project/account using the documented controls. Do not include secrets. It is categorised as a Write tool in the Meridian MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
update_custom_hook accepts 10 parameters: name, event, enabled, hook_id, matcher, blocking, script_sh, project_id, script_ps1, project_name. Required: hook_id. The full parameter table on this page comes from the server's own tool schema.
Register the Meridian MCP server in PolicyLayer and add a rule for update_custom_hook: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Meridian. Nothing to install.
update_custom_hook is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the update_custom_hook rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for update_custom_hook. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
update_custom_hook is provided by the Meridian MCP server (@meridianmcp/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Meridian, and thousands of servers like it.
This server
Across the catalogue