Tools Filter

v1.0.0Developer Toolsstable

Fetch only relevant tools for the current conversation and save cost while increasing the precision of your LLM Response

genai-chatbotgenai-guardrailsgenai-usecasegenerative-aillm-inference
Share:
17
Stars
0
Downloads
0
Weekly
0/5

What is Tools Filter?

Tools Filter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to fetch only relevant tools for the current conversation and save cost while increasing the precision of your llm response

Fetch only relevant tools for the current conversation and save cost while increasing the precision of your LLM Response

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Fetch only relevant tools for the current conversation and s

Use Cases

Filter and fetch only relevant tools for each conversation.
Reduce LLM costs by limiting tool exposure.
Improve response precision with targeted tool selection.
OppieAI

Maintainer

LicenseNOASSERTION
Languagepython
Versionv1.0.0
UpdatedJan 29, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx toolsfilter

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Tools Filter

ToolsFilter (OppieAI) is a Precision-driven Tool Recommendation (PTR) MCP service that solves the tool-overload problem in LLM applications: when agents have access to hundreds of tools, accuracy drops and token costs spike. ToolsFilter acts as an intelligent middleware layer — given the current conversation and a list of available tools, it returns only the 3-5 most relevant tools using a multi-stage pipeline of semantic search, BM25 hybrid retrieval, cross-encoder reranking, and an XGBoost learning-to-rank model. Research shows this approach eliminates up to 236x token overhead while achieving perfect Precision@1 and MRR scores in evaluation.

Prerequisites

  • Python 3.11 or later
  • Docker and Docker Compose for running the vector database and Redis cache
  • An API key for an embedding provider: Voyage AI, OpenAI, or Cohere
  • An MCP-compatible client or integration point that can call the ToolsFilter REST API
1

Clone the repository

Clone the OppieAI ToolsFilter repository from GitHub.

git clone https://github.com/OppieAI/ToolsFilter.git
cd ToolsFilter
2

Create a virtual environment and install dependencies

Set up an isolated Python environment and install the required packages.

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
3

Configure environment variables

Create a .env file with your embedding provider API key and other settings. Voyage AI is the default primary embedding model.

# .env
PRIMARY_EMBEDDING_MODEL=voyage-2
VOYAGE_API_KEY=your_voyage_api_key
# Or use OpenAI:
# PRIMARY_EMBEDDING_MODEL=text-embedding-3-small
# OPENAI_API_KEY=your_openai_api_key
FALLBACK_EMBEDDING_MODEL=text-embedding-3-small
MAX_TOOLS_TO_RETURN=10
SIMILARITY_THRESHOLD=0.7
4

Start the supporting services with Docker Compose

Launch Qdrant (vector database) and Redis (caching) using the included Docker Compose file.

docker-compose up -d
5

Start the ToolsFilter API server

Launch the FastAPI application. It will be available at http://localhost:8000.

uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
6

Register your tools and start filtering

POST your available tools to the register endpoint, then call the filter endpoint with conversation messages to get back only the relevant tools for the current context.

# Register tools
curl -X POST http://localhost:8000/api/v1/tools/register \
  -H 'Content-Type: application/json' \
  -d '{"tools": [{"type": "function", "name": "grep", "description": "Search file contents"}]}'

# Filter for current conversation
curl -X POST http://localhost:8000/api/v1/tools/filter \
  -H 'Content-Type: application/json' \
  -d '{"messages": [{"role": "user", "content": "Search for Python files"}], "available_tools": [...]}'  

Tools Filter Examples

Client configuration

ToolsFilter runs as a standalone REST service rather than a direct MCP stdio server. MCP clients that support HTTP-based tool filtering can point to it directly.

{
  "mcpServers": {
    "toolsfilter": {
      "url": "http://localhost:8000",
      "type": "http"
    }
  }
}

API usage example

Example of calling the filter endpoint from Python to get relevant tools for a conversation turn.

import requests

response = requests.post(
    "http://localhost:8000/api/v1/tools/filter",
    json={
        "messages": [
            {"role": "user", "content": "Search for Python files in the project"}
        ],
        "available_tools": [
            {"type": "function", "name": "grep", "description": "Search file contents by pattern"},
            {"type": "function", "name": "find", "description": "Find files by name"}
        ]
    }
)
print(response.json())
# Returns: {"recommended_tools": [{"tool_name": "find", "confidence": 0.95}, ...]}

Troubleshooting Tools Filter

Embedding API errors or rate limit failures on startup

Set FALLBACK_EMBEDDING_MODEL and the corresponding API key in .env. ToolsFilter will automatically switch to the fallback when the primary embedding provider returns errors or hits rate limits.

Tool filter returns empty or irrelevant results

Lower the SIMILARITY_THRESHOLD in .env (default 0.7) if relevant tools are being filtered out. Also make sure your tools were registered via the /api/v1/tools/register endpoint before calling /filter — tools must be indexed into the Qdrant vector store first.

Docker services (Qdrant or Redis) fail to start

Make sure Docker Desktop is running and ports 6333 (Qdrant) and 6379 (Redis) are not already in use. Run 'docker-compose logs' to see specific error messages and address port conflicts.

Frequently Asked Questions about Tools Filter

What is Tools Filter?

Tools Filter is a Model Context Protocol (MCP) server that fetch only relevant tools for the current conversation and save cost while increasing the precision of your llm response It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Tools Filter?

Follow the installation instructions on the Tools Filter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Tools Filter?

Tools Filter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Tools Filter free to use?

Yes, Tools Filter is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "toolsfilter": { "command": "npx", "args": ["-y", "toolsfilter"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Tools Filter?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides