Is it possible to pipe MCP tool calls? #2072

Closed
opened 2026-02-16 17:34:01 -05:00 by yindo · 5 comments
Owner

Originally created by @Kirow on GitHub (Oct 13, 2025).

Originally assigned to: @thdxr on GitHub.

Recently I've used JIRA MCP, and some of the tools produce 150k+ tokens (seems their builtin filters not working ) in JSON format that don't fit my context window. But actually I don't need all data, but small filtered subset. And I was thinking if it possible to make configuration so tool response will be processed by another tool before being sent to the context. For example tools like jq for JSON would make it work.

Any ideas or suggestions how to make it?

Originally created by @Kirow on GitHub (Oct 13, 2025). Originally assigned to: @thdxr on GitHub. Recently I've used JIRA MCP, and some of the tools produce 150k+ tokens (seems their builtin filters not working ) in JSON format that don't fit my context window. But actually I don't need all data, but small filtered subset. And I was thinking if it possible to make configuration so tool response will be processed by another tool before being sent to the context. For example tools like `jq` for JSON would make it work. Any ideas or suggestions how to make it?
yindo closed this issue 2026-02-16 17:34:01 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

I think you would need to write custom tools to allow this https://opencode.ai/docs/custom-tools/

@rekram1-node commented on GitHub (Oct 13, 2025): I think you would need to write custom tools to allow this https://opencode.ai/docs/custom-tools/
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

Tbh if jira mcp outputs that many tokens I wouldn't recommend using it unless they have a param for limiting it, maybe tell agent to always set that param

You could easily write your own tools for jira probably tho

@rekram1-node commented on GitHub (Oct 13, 2025): Tbh if jira mcp outputs that many tokens I wouldn't recommend using it unless they have a param for limiting it, maybe tell agent to always set that param You could easily write your own tools for jira probably tho
Author
Owner

@Kirow commented on GitHub (Oct 13, 2025):

Tbh if jira mcp outputs that many tokens I wouldn't recommend using it unless they have a param for limiting it, maybe tell agent to always set that param

You could easily write your own tools for jira probably tho

They have filtering params on failed tool, but seems it not applied.

Docker-Mcp-Toolkit_jira_get_sprint_issues key,summary,status,assignee,story points (limit=50, sprint_id=930)
In JSON I can also see "description", that produce MOST of the size.

I think you would need to write custom tools to allow this https://opencode.ai/docs/custom-tools/

@rekram1-node Just to clarify, is it possible to call existing MCP tool inside custom tool?

@Kirow commented on GitHub (Oct 13, 2025): > Tbh if jira mcp outputs that many tokens I wouldn't recommend using it unless they have a param for limiting it, maybe tell agent to always set that param > > You could easily write your own tools for jira probably tho They have filtering params on failed tool, but seems it not applied. `Docker-Mcp-Toolkit_jira_get_sprint_issues key,summary,status,assignee,story points (limit=50, sprint_id=930)` In JSON I can also see "description", that produce MOST of the size. > I think you would need to write custom tools to allow this https://opencode.ai/docs/custom-tools/ @rekram1-node Just to clarify, is it possible to call existing MCP tool inside custom tool?
Author
Owner

@rekram1-node commented on GitHub (Oct 13, 2025):

You can define custom tools in typescript so anything is possible, but I think you'd have to make an mcp connection yourself I don't think we expose an easy way to hook into the existing ones

@rekram1-node commented on GitHub (Oct 13, 2025): You can define custom tools in typescript so anything is possible, but I think you'd have to make an mcp connection yourself I don't think we expose an easy way to hook into the existing ones
Author
Owner

@Kirow commented on GitHub (Oct 13, 2025):

Well, actually it seems easier to fix filtering in JIRA MCP implementation...And guess I will do it this way.

But in general tool chaining maybe not so bad idea

@Kirow commented on GitHub (Oct 13, 2025): Well, actually it seems easier to fix filtering in JIRA MCP implementation...And guess I will do it this way. But in general tool chaining maybe not so bad idea
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2072