search_endpoints
Find API endpoints using natural language queries to locate semantically similar endpoints for your integration needs.
Instructions
Search for API endpoints using natural language. Returns semantically similar endpoints based on the query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language description of what you're looking for | |
| api_id | No | Optional: limit search to a specific API | |
| top_k | No | Number of results to return (default: 5) |
Implementation Reference
- src/jitapi/mcp/tools.py:376-400 (handler)The _search_endpoints method in MCPTools handles the execution of the search_endpoints tool by delegating to a vector_searcher.
async def _search_endpoints(self, args: dict[str, Any]) -> ToolResult: """Search for endpoints.""" query = args["query"] api_id = args.get("api_id") top_k = args.get("top_k", 5) results = self.vector_searcher.search(query, api_id=api_id, top_k=top_k) return ToolResult( success=True, data={ "query": query, "results": [ { "endpoint_id": r.endpoint_id, "api_id": r.api_id, "path": r.path, "method": r.method, "summary": r.summary, "score": round(r.score, 3), } for r in results ], "count": len(results), }, - src/jitapi/mcp/models.py:43-55 (schema)The SearchEndpointsInput Pydantic model defines the input schema for the search_endpoints tool.
class SearchEndpointsInput(BaseModel): """Input for search_endpoints tool.""" query: str = Field( ..., description="Natural language search query", min_length=1, max_length=500, ) api_id: str | None = Field( None, description="Optional: limit search to a specific API", ) - src/jitapi/mcp/tools.py:120-135 (registration)The search_endpoints tool is defined in the list of available tools provided by the MCP server.
"name": "search_endpoints", "description": "Search for API endpoints using natural language. " "Returns semantically similar endpoints based on the query.", "inputSchema": { "type": "object", "properties": { "query": { "type": "string", "description": "Natural language description of what you're looking for", }, "api_id": { "type": "string", "description": "Optional: limit search to a specific API", }, "top_k": { "type": "integer",