Tool search

Palantir MCP supports on-demand tool discovery through tool search. When tool search is enabled, the server exposes a single tool, search_tools, at startup instead of the full tool catalog. Your agent activates additional tools only as it searches for them, so fewer tool definitions load into your context, which reduces token usage.

How tool search works

By default, all tools load at startup and remain available throughout the session. When tool search is enabled, Palantir MCP starts up exposing only the search_tools tool. From there:

  1. When you prompt the agent, the agent calls search_tools with a short description of your task.
  2. search_tools ranks the catalog locally on tool name, category, and curated keywords, with no extra model call or network round-trip. It then activates the best-matching tools and returns their descriptions.
  3. The agent calls the activated tool directly.

This keeps your context small. Instead of loading dozens of tool definitions up front, the agent loads only the handful relevant to the task.

Activated tools remain in your tool list and your context for the rest of the session. Reconnecting to the server resets your tool list to only search_tools.

Client requirement: Tool search relies on your MCP client refreshing its tool list when new tools are activated, using the tools/list_changed notification. Clients that do not refresh dynamically will not see newly activated tools. For this reason, Continue does not use tool search.

Tool search is opt-in. By default, all tools load at startup. To enable tool search, either:

  • Pass the --tool-search argument to the server, or
  • Set the environment variable PALANTIR_MCP_TOOL_SEARCH=true.

The two options are equivalent; use whichever fits your setup.

Claude Code

When you add Palantir MCP with claude mcp add, pass the --tool-search argument. The argument must go after the -- separator, as an argument to palantir-mcp and not to claude mcp add.

Copied!
1 2 3 4 claude mcp add palantir-mcp \ --scope project \ -e FOUNDRY_TOKEN=<token> \ -- npx "-y" "palantir-mcp" "--tool-search" "--foundry-api-url" "https://<your-foundry-hostname>.palantirfoundry.com"

Alternatively, set the environment variable:

Copied!
1 2 3 4 5 claude mcp add palantir-mcp \ --scope project \ -e FOUNDRY_TOKEN=<token> \ -e PALANTIR_MCP_TOOL_SEARCH=true \ -- npx "-y" "palantir-mcp" "--foundry-api-url" "https://<your-foundry-hostname>.palantirfoundry.com"

Agent Flows (pro-code agents)

In a pro-code agent, add the --tool-search argument to the server configuration:

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 export const PALANTIR_MCP_CONFIGURATION: McpStdioServerConfig = { type: "stdio", command: "palantir-mcp", args: ["start", "--tool-search", "code-workspaces"], env: { FOUNDRY_PROXY_URL: `https://${process.env.FOUNDRY_PROXY_URL!}/`, FOUNDRY_SERVICE_DISCOVERY_V2: process.env.FOUNDRY_SERVICE_DISCOVERY_V2!, FOUNDRY_EXTERNAL_HOST: "https://<your-foundry-hostname>.palantirfoundry.com", FOUNDRY_PROXY_TOKEN: process.env.FOUNDRY_PROXY_TOKEN!, FOUNDRY_SCOPED_TOKEN: process.env.FOUNDRY_SCOPED_TOKEN!, MAESTRO_REPO_RID: process.env.MAESTRO_REPO_RID!, NODE_EXTRA_CA_CERTS: process.env.NODE_EXTRA_CA_CERTS!, }, };

Alternatively, add PALANTIR_MCP_TOOL_SEARCH: "true" to the env block instead of passing the --tool-search argument.