Skip to content

add filtering by gateway id#1416

Merged
crivetimihai merged 1 commit intoIBM:mainfrom
ramcysiddique:filter_tools
Nov 12, 2025
Merged

add filtering by gateway id#1416
crivetimihai merged 1 commit intoIBM:mainfrom
ramcysiddique:filter_tools

Conversation

@ramcysiddique
Copy link
Copy Markdown
Contributor

@ramcysiddique ramcysiddique commented Nov 11, 2025

Closes #1409

This PR includes code changes to support filtering toolkits based on gateway_id.

@ramcysiddique
Copy link
Copy Markdown
Contributor Author

ramcysiddique commented Nov 11, 2025

Attaching the test result: Tools response filtered based on gateway_id passed as part of input queryparam.

curl -X 'GET' \
  'http://localhost:5555/tools/?include_inactive=false&gateway_id=21cc9d57a2b14a53a866918321ab1177' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json'
  
  [
  {
    "id": "c4302fa482e4413d906110ca3df0ab0c",
    "originalName": "get_alerts",
    "url": "https://weather-mcp-server.1ztdssb3chnz.us-south.codeengine.appdomain.cloud/sse",
    "description": "Get weather alerts for a US state.\n\n    Args:\n        state: Two-letter US state code (e.g. CA, NY)",
    "requestType": "SSE",
    "integrationType": "MCP",
    "headers": null,
    "inputSchema": {
      "properties": {
        "state": {
          "title": "State",
          "type": "string"
        }
      },
      "required": [
        "state"
      ],
      "title": "get_alertsArguments",
      "type": "object"
    },
    "outputSchema": {
      "properties": {
        "result": {
          "title": "Result",
          "type": "string"
        }
      },
      "required": [
        "result"
      ],
      "title": "get_alertsOutput",
      "type": "object"
    },
    "annotations": {},
    "jsonpathFilter": "",
    "auth": null,
    "createdAt": "2025-11-09T04:59:46.421415Z",
    "updatedAt": "2025-11-10T10:38:57.318248Z",
    "enabled": true,
    "reachable": true,
    "gatewayId": "21cc9d57a2b14a53a866918321ab1177",
    "executionCount": 1,
    "metrics": {
      "totalExecutions": 1,
      "successfulExecutions": 1,
      "failedExecutions": 0,
      "failureRate": 0,
      "minResponseTime": 4.31605695898179,
      "maxResponseTime": 4.31605695898179,
      "avgResponseTime": 4.31605695898179,
      "lastExecutionTime": "2025-11-09T05:01:11.004202Z"
    },
    "name": "sse-weather-new-get-alerts",
    "displayName": "Get Alerts",
    "gatewaySlug": "sse-weather-new",
    "customName": "get_alerts",
    "customNameSlug": "get-alerts",
    "tags": [],
    "createdBy": "wxo.archer@ibm.com",
    "createdFromIp": "127.0.0.1",
    "createdVia": "federation",
    "createdUserAgent": "python-requests/2.32.5",
    "modifiedBy": null,
    "modifiedFromIp": null,
    "modifiedVia": null,
    "modifiedUserAgent": null,
    "importBatchId": null,
    "federationSource": "sse-weather-new",
    "version": 1,
    "teamId": "9643f6ef1c024e4aababd725016211b2",
    "team": "Platform Administrator's Team",
    "ownerEmail": "admin@example.com",
    "visibility": "public",
    "baseUrl": null,
    "pathTemplate": null,
    "queryMapping": null,
    "headerMapping": null,
    "timeoutMs": null,
    "exposePassthrough": true,
    "allowlist": null,
    "pluginChainPre": null,
    "pluginChainPost": null
  },
  {
    "id": "d718e02bb85e4fe09b53d1aab8c095a0",
    "originalName": "get_forecast",
    "url": "https://weather-mcp-server.1ztdssb3chnz.us-south.codeengine.appdomain.cloud/sse",
    "description": "Get weather forecast for a location.\n\n    Args:\n        latitude: Latitude of the location\n        longitude: Longitude of the location",
    "requestType": "SSE",
    "integrationType": "MCP",
    "headers": null,
    "inputSchema": {
      "properties": {
        "latitude": {
          "title": "Latitude",
          "type": "number"
        },
        "longitude": {
          "title": "Longitude",
          "type": "number"
        }
      },
      "required": [
        "latitude",
        "longitude"
      ],
      "title": "get_forecastArguments",
      "type": "object"
    },
    "outputSchema": {
      "properties": {
        "result": {
          "title": "Result",
          "type": "string"
        }
      },
      "required": [
        "result"
      ],
      "title": "get_forecastOutput",
      "type": "object"
    },
    "annotations": {},
    "jsonpathFilter": "",
    "auth": null,
    "createdAt": "2025-11-09T04:59:46.421420Z",
    "updatedAt": "2025-11-10T10:38:57.318249Z",
    "enabled": true,
    "reachable": true,
    "gatewayId": "21cc9d57a2b14a53a866918321ab1177",
    "executionCount": 0,
    "metrics": {
      "totalExecutions": 0,
      "successfulExecutions": 0,
      "failedExecutions": 0,
      "failureRate": 0,
      "minResponseTime": null,
      "maxResponseTime": null,
      "avgResponseTime": null,
      "lastExecutionTime": null
    },
    "name": "sse-weather-new-get-forecast",
    "displayName": "Get Forecast",
    "gatewaySlug": "sse-weather-new",
    "customName": "get_forecast",
    "customNameSlug": "get-forecast",
    "tags": [],
    "createdBy": "wxo.archer@ibm.com",
    "createdFromIp": "127.0.0.1",
    "createdVia": "federation",
    "createdUserAgent": "python-requests/2.32.5",
    "modifiedBy": null,
    "modifiedFromIp": null,
    "modifiedVia": null,
    "modifiedUserAgent": null,
    "importBatchId": null,
    "federationSource": "sse-weather-new",
    "version": 1,
    "teamId": "9643f6ef1c024e4aababd725016211b2",
    "team": "Platform Administrator's Team",
    "ownerEmail": "admin@example.com",
    "visibility": "public",
    "baseUrl": null,
    "pathTemplate": null,
    "queryMapping": null,
    "headerMapping": null,
    "timeoutMs": null,
    "exposePassthrough": true,
    "allowlist": null,
    "pluginChainPre": null,
    "pluginChainPost": null
  }
]

Copy link
Copy Markdown
Member

@kevalmahajan kevalmahajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected.

Copy link
Copy Markdown
Collaborator

@MohanLaksh MohanLaksh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as intended.

Lists only tools corresponding to the associated gateway in the URL


mohanlaksh@IBM-PF3PFAJ7:~$ curl -X 'GET' 'http://localhost:4444/tools?include_inactive=false&gateway_id=2dc2464a812a467cbead3a09b454e77e' -H 'accept: application/json' -H 'Cookie: jwt_token=ey**********************************RQs' -H 'Content-Type: application/json' | jq


@crivetimihai crivetimihai self-assigned this Nov 12, 2025
@crivetimihai crivetimihai merged commit 6c21010 into IBM:main Nov 12, 2025
44 checks passed
Nayana-R-Gowda pushed a commit that referenced this pull request Nov 14, 2025
Co-authored-by: ramcysiddique <ramcy.siddique@ibm.com>
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
Co-authored-by: ramcysiddique <ramcy.siddique@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE][API]: Filtering by gateway ID in List Tools API

4 participants