Uh oh!
There was an error while loading. Please reload this page.
Document Patch tool input hooks and chat channel filter context - #452
Closed
mhornbacher wants to merge 1 commit into
Closed
Document Patch tool input hooks and chat channel filter context#452mhornbacher wants to merge 1 commit into
mhornbacher wants to merge 1 commit into
Conversation
Adds a "Patch tool input hooks" section covering the two configuration modes (CEL expression and static JSON), the variables a patch expression can read, the add/overwrite/remove-via-null merge rules, and two worked examples. Documents the ctx.surface and ctx.channel_id filter variables now available on the pre-tool-use and post-tool-use events, including that they are absent rather than empty for calls that didn't originate in a chat channel, and adds them to the custom function payload. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
mhornbacherforce-pushed
the
menachem.hornbacher/docs/patch-tool-input-hook
branch
from
August 11, 2026 18:10
ea1dec1 to
01bff7bComparemhornbacher
commented
Aug 11, 2026
Author
Closing — this was mistakenly stacked on an unmerged branch (sathya/add-agent-guardrails-doc). Filters are GA, so this doc addition doesn't need to wait on that branch; redoing it directly against main in a new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents two additions to tool call hooks for their launch.
Stacked on #432 — that PR rewrites
tool-call-hooks.mdx(new pre-output event, filter-variables-by-event table, eleven built-in patterns), so this targets its branch rather thanmainto avoid conflicting edits. Retarget tomainonce #432 merges.What changed
product/admin/tool-call-hooks.mdxonly.New hook type —
## Patch tool input hooks, placed between the built-in patterns and custom function sections, since it sits between them in complexity. Follows the depth of the neighboring type sections: what it's for, the pre-tool-use-only constraint, the two configuration modes (CEL expression and static JSON), a### Patch expression variablestable (ctx,input,caller),### How the patch is applied, and two worked examples — stamping a scope onto Datadog calls from one Slack channel, and a static patch that pins one field and drops another.The merge behavior is explained in plain terms first — a key is added, overwritten, or removed when set to
null, and unmentioned keys are untouched — with a link to JSON Merge Patch for precision rather than as the explanation. This matches how the docs cite specs elsewhere (for example step-up auth linking RFC 9470).New filter context —
### Chat channel contextunder Configure a hook, documentingctx.surfaceandctx.channel_idon the pre-tool-use and post-tool-use events. Emphasizes that both are absent rather than empty for calls that didn't come from a chat channel, so filters needhas()first — otherwise the expression fails to evaluate and the fail-closed rule denies the call. The existing Filter variables by event table points here, and thecontextblock in the custom function payload gains both fields.Also updated: the frontmatter description, the Hook type and Event rows of the configuration form table, and the hook-type step of the setup flow.
Test plan
npx mintlify broken-links— no new broken links; the 10 reported are pre-existing in unrelated files. All new anchors verified against real headings.