Skip to content

feat: add search tool to mcp#1203

Merged
yelizhenden-mdb merged 3 commits into
mainfrom
CLOUDP-393141-2
Apr 10, 2026
Merged

feat: add search tool to mcp#1203
yelizhenden-mdb merged 3 commits into
mainfrom
CLOUDP-393141-2

Conversation

@yelizhenden-mdb

@yelizhenden-mdb yelizhenden-mdb commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Proposed changes

Jira ticket: CLOUDP-393141

This PR adds a search tool to the MCP server that enables regex-based search across OpenAPI specifications.It allows searching with the following features:

  • Regex pattern matching - Search using regular expressions (case-sensitive or case-insensitive)
  • Multi-category search - Search across 6 categories: operations, schemas, parameters, responses, tags, and paths
  • Flexible filtering - Optionally limit search to specific categories
  • Match context - Returns which fields matched (matchedIn) and the matched text
  • Pagination - Configurable result limits with metadata showing total matches and available results per category

What Gets Searched

Operations

  • operationId: The unique identifier for the operation
  • summary: Brief description of the operation
  • description: Detailed description of the operation
  • tags: Tags associated with the operation

Schemas

  • name: Schema name
  • description: Schema description
  • properties: Property names within the schema

Parameters

  • name: Parameter name
  • description: Parameter description

Responses

  • name: Response name
  • description: Response description

Tags

  • name: Tag name
  • description: Tag description

Paths

  • path: The path pattern itself (e.g., /users/{userId})

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Further comments

@yelizhenden-mdb yelizhenden-mdb changed the title feat(mcp): add search tool feat: add search tool Apr 9, 2026
@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review April 9, 2026 15:53
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner April 9, 2026 15:53
@yelizhenden-mdb yelizhenden-mdb changed the title feat: add search tool feat: add search tool to mcp Apr 9, 2026

@andmatei andmatei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

// Register search tool
searchTool := &mcp.Tool{
Name: "search",
Description: "Search for patterns in an OpenAPI specification using regular expressions",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[nit] Since this description will be used by the agent I think it might be a good idea to add what the agent can search against (operation, tags etc.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added more detailed descriptions for all the tools implemented until now. Feel free to take a second look!

@yelizhenden-mdb yelizhenden-mdb merged commit 8fe9dee into main Apr 10, 2026
7 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-393141-2 branch April 10, 2026 14:02
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.

2 participants