Replies: 3 comments 2 replies
-
|
Hi @alex9434, thanks for the feature request. I can provide a concrete example for transformation patterns if you share your target output shape and whether this is at tool definition time or per-call transform. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @alex9434, good news — this is already supported via the The Updated tool definition with jq filter: [
{
"name": "web-search",
"displayName": "SearXNG web",
"url": "http://172.17.0.1:5346/search?format=json&safesearch=1",
"integration_type": "REST",
"request_type": "GET",
"description": "Search the internet with keywords",
"headers": {
"Accept": "application/json",
"User-Agent": "MCP-Gateway/1.0"
},
"jsonpath_filter": "{query, results: [.results[] | {url, title, content, score, category}], suggestions}",
"input_schema": {
"type": "object",
"properties": {
"q": {
"type": "string",
"description": "The search query string. Required."
},
"language": {
"type": "string",
"description": "Language code. Optional, default is 'en'.",
"default": "en"
},
"categories": {
"type": "string",
"description": "Categories to search in.",
"enum": ["general", "news", "it_category", "science", "social_media", "map"],
"default": "general"
}
},
"required": ["q"]
},
"tags": ["search", "api", "internal"]
}
]The
Note: The output will still be serialized as a text content block in the MCP response (this is how MCP tool results work), but the JSON inside will be clean and minimal. You can also add an You can set |
Beta Was this translation helpful? Give feedback.
-
|
The previous comments from crivetimihai said that jsonpath_filter field on tool definitions is already supported, using jq syntax to transform REST API responses before they're returned to the MCP client. They gave an example for SearXNG use case. The user hasn't shown the updated tool definition yet; they just posted the original bulk import. The question is "Howto: JSON transformation for REST output". Provide a concrete example of jsonpath_filter usage for this specific case. Possibly show how to extract only the results array, or maybe map to a simpler shape. Not repeat what crivetimihai said, but build on it or correct if wrong. They said jsonpath_filter uses jq syntax. That's correct per the repo? I need to recall: In mcp-context-forge, tool definitions can have a "transform" field? Actually, I'm not familiar with this repo, but based on the comment, jsonpath_filter is a field. We |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear all,
I want to include a "web-search" service that searches using a local SearXNG instance. Here is the JSON I use for "bulk import":
The issue with this definition is the output that the MCP gateway than provides to clients. The original reply from SearXNG looks like this:
However, MCP Context Forge returns this:
I think the issue is that I need to define an Output Schema (JSON) but I cannot find how to do it? Here is what I want:
Can anyone help me with this? I am stuck. Is there any documentation on how to do this. I could not find anything.
Beta Was this translation helpful? Give feedback.
All reactions