Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Fix modifiers

haxzie913c2c408172
diff --git a/fern/pages/src/tool-calling/after-execution-modifiers.mdx b/fern/pages/src/tool-calling/after-execution-modifiers.mdx
index 94f632eda..d7aa7497c 100644
--- a/fern/pages/src/tool-calling/after-execution-modifiers.mdx
+++ b/fern/pages/src/tool-calling/after-execution-modifiers.mdx
@@ -22,7 +22,7 @@ These modifiers are called after the tool is executed by the LLM. This allows yo
</Frame>
<Note>
- Below we use the `afterToolExecute` modifier to truncate the output of the `HACKERNEWS_GET_USER`
+ Below we use the `afterExecute` modifier to truncate the output of the `HACKERNEWS_GET_USER`
tool and only return the karma of the user.
</Note>
@@ -56,7 +56,7 @@ if (tool_calls) {
arguments: JSON.parse(toolArgs),
},
{
- afterToolExecute: (toolSlug, _, result) => {
+ afterExecute: ({ toolSlug, toolkitSlug, result }) => {
if (toolSlug === "HACKERNEWS_GET_USER") {
const { data } = result;
const { karma } = data.response_data as { karma: number };
diff --git a/fern/pages/src/tool-calling/before-execution-modifiers.mdx b/fern/pages/src/tool-calling/before-execution-modifiers.mdx
index ef8ead7a3..9c0f41fad 100644
--- a/fern/pages/src/tool-calling/before-execution-modifiers.mdx
+++ b/fern/pages/src/tool-calling/before-execution-modifiers.mdx
@@ -22,7 +22,7 @@ These modifiers are called before the tool is executed by the LLM. This allows y
</Frame>
<Note>
- Below we use the `beforeToolExecute` modifier to modify the number of posts returned by the
+ Below we use the `beforeExecute` modifier to modify the number of posts returned by the
`HACKERNEWS_GET_LATEST_POSTS` tool.
</Note>
@@ -56,7 +56,7 @@ if (tool_calls) {
arguments: JSON.parse(toolArgs),
},
{
- beforeToolExecute: (toolSlug, _, params) => {
+ beforeExecute: { toolSlug, toolkitSlug, params }) => {
if (toolSlug === "HACKERNEWS_GET_LATEST_POSTS") {
params.arguments.size = 1;
}
diff --git a/fern/pages/src/tool-calling/schema-modifiers.mdx b/fern/pages/src/tool-calling/schema-modifiers.mdx
index bccabd306..27f1fe77b 100644
--- a/fern/pages/src/tool-calling/schema-modifiers.mdx
+++ b/fern/pages/src/tool-calling/schema-modifiers.mdx
@@ -35,15 +35,15 @@ const tools = await composio.tools.get(
tools: ["HACKERNEWS_GET_LATEST_POSTS", "HACKERNEWS_GET_USER"],
},
{
- modifyToolSchema: (toolSlug, _, toolSchema) => {
+ modifyToolSchema: ({ toolSlug, toolkitSlug, schema }) => {
if (toolSlug === "HACKERNEWS_GET_LATEST_POSTS") {
- const { inputParameters } = toolSchema;
+ const { inputParameters } = schema;
if (inputParameters?.properties) {
delete inputParameters.properties["page"];
}
inputParameters.required = ["size"];
}
- return toolSchema;
+ return schema;
},
}
);