fix(coding-agent): updated Exa MCP tool names to match current API
Exa changed their MCP tool names: web_search→web_search_exa, crawling_exa→crawling, linkedin_search_exa→linkedin_search, company_research_exa→company_research. Also fixed num_results→numResults param and removed deep_search_exa (now uses web_search_exa with type:deep).
This commit is contained in:
@@ -34,7 +34,7 @@ Parameters:
|
||||
details: { error: "EXA_API_KEY not found", toolName: "exa_company" },
|
||||
};
|
||||
}
|
||||
const response = await callExaTool("company_research_exa", params, apiKey);
|
||||
const response = await callExaTool("company_research", params, apiKey);
|
||||
|
||||
if (isSearchResponse(response)) {
|
||||
const formatted = formatSearchResults(response);
|
||||
|
||||
@@ -34,7 +34,7 @@ Parameters:
|
||||
details: { error: "EXA_API_KEY not found", toolName: "exa_linkedin" },
|
||||
};
|
||||
}
|
||||
const response = await callExaTool("linkedin_search_exa", params, apiKey);
|
||||
const response = await callExaTool("linkedin_search", params, apiKey);
|
||||
|
||||
if (isSearchResponse(response)) {
|
||||
const formatted = formatSearchResults(response);
|
||||
|
||||
@@ -91,7 +91,7 @@ Parameters:
|
||||
details: { error: "EXA_API_KEY not found", toolName: "exa_search" },
|
||||
};
|
||||
}
|
||||
const response = await callExaTool("web_search", params, apiKey);
|
||||
const response = await callExaTool("web_search_exa", params, apiKey);
|
||||
|
||||
if (isSearchResponse(response)) {
|
||||
const formatted = formatSearchResults(response);
|
||||
@@ -187,7 +187,8 @@ Similar parameters to exa_search, optimized for research depth.`,
|
||||
details: { error: "EXA_API_KEY not found", toolName: "exa_search_deep" },
|
||||
};
|
||||
}
|
||||
const response = await callExaTool("deep_search_exa", params, apiKey);
|
||||
const args = { ...params, type: "deep" };
|
||||
const response = await callExaTool("web_search_exa", args, apiKey);
|
||||
|
||||
if (isSearchResponse(response)) {
|
||||
const formatted = formatSearchResults(response);
|
||||
@@ -305,7 +306,7 @@ Parameters:
|
||||
details: { error: "EXA_API_KEY not found", toolName: "exa_crawl" },
|
||||
};
|
||||
}
|
||||
const response = await callExaTool("crawling_exa", params, apiKey);
|
||||
const response = await callExaTool("crawling", params, apiKey);
|
||||
|
||||
if (isSearchResponse(response)) {
|
||||
const formatted = formatSearchResults(response);
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface MCPToolWrapperConfig {
|
||||
name: string;
|
||||
/** Display label for UI */
|
||||
label: string;
|
||||
/** MCP tool name to call (e.g., "web_search") */
|
||||
/** MCP tool name to call (e.g., "web_search_exa") */
|
||||
mcpToolName: string;
|
||||
/** Whether this is a websets tool (uses different MCP endpoint) */
|
||||
isWebsetsTool?: boolean;
|
||||
@@ -121,14 +121,13 @@ export interface WebsetEnrichment {
|
||||
/** Tool name mappings: MCP name -> our tool name */
|
||||
export const EXA_TOOL_MAPPINGS = {
|
||||
// Search tools
|
||||
web_search: "exa_search",
|
||||
deep_search_exa: "exa_search_deep",
|
||||
web_search_exa: "exa_search",
|
||||
get_code_context_exa: "exa_search_code",
|
||||
crawling_exa: "exa_crawl",
|
||||
crawling: "exa_crawl",
|
||||
// LinkedIn
|
||||
linkedin_search_exa: "exa_linkedin",
|
||||
linkedin_search: "exa_linkedin",
|
||||
// Company
|
||||
company_research_exa: "exa_company",
|
||||
company_research: "exa_company",
|
||||
// Researcher
|
||||
deep_researcher_start: "exa_researcher_start",
|
||||
deep_researcher_check: "exa_researcher_poll",
|
||||
|
||||
@@ -345,7 +345,9 @@ Parameters:
|
||||
parameters: webSearchDeepSchema,
|
||||
|
||||
async execute(_toolCallId, params, _onUpdate, _ctx, _signal) {
|
||||
return executeExaTool("deep_search_exa", params as Record<string, unknown>, "web_search_deep");
|
||||
const { num_results, ...rest } = params as Record<string, unknown>;
|
||||
const args = { ...rest, type: "deep", numResults: num_results ?? 10 };
|
||||
return executeExaTool("web_search_exa", args, "web_search_deep");
|
||||
},
|
||||
|
||||
renderCall(args, theme) {
|
||||
@@ -404,7 +406,7 @@ Parameters:
|
||||
parameters: webSearchCrawlSchema,
|
||||
|
||||
async execute(_toolCallId, params, _onUpdate, _ctx, _signal) {
|
||||
return executeExaTool("crawling_exa", params as Record<string, unknown>, "web_search_crawl");
|
||||
return executeExaTool("crawling", params as Record<string, unknown>, "web_search_crawl");
|
||||
},
|
||||
|
||||
renderCall(args, theme) {
|
||||
@@ -435,7 +437,7 @@ Parameters:
|
||||
parameters: webSearchLinkedinSchema,
|
||||
|
||||
async execute(_toolCallId, params, _onUpdate, _ctx, _signal) {
|
||||
return executeExaTool("linkedin_search_exa", params as Record<string, unknown>, "web_search_linkedin");
|
||||
return executeExaTool("linkedin_search", params as Record<string, unknown>, "web_search_linkedin");
|
||||
},
|
||||
|
||||
renderCall(args, theme) {
|
||||
@@ -465,7 +467,7 @@ Parameters:
|
||||
parameters: webSearchCompanySchema,
|
||||
|
||||
async execute(_toolCallId, params, _onUpdate, _ctx, _signal) {
|
||||
return executeExaTool("company_research_exa", params as Record<string, unknown>, "web_search_company");
|
||||
return executeExaTool("company_research", params as Record<string, unknown>, "web_search_company");
|
||||
},
|
||||
|
||||
renderCall(args, theme) {
|
||||
|
||||
@@ -248,10 +248,8 @@ export async function searchExa(params: ExaSearchParams): Promise<WebSearchRespo
|
||||
|
||||
const args: Record<string, unknown> = {
|
||||
query: params.query,
|
||||
num_results: params.num_results ?? 10,
|
||||
numResults: params.num_results ?? 10,
|
||||
type: params.type ?? "auto",
|
||||
text: true, // Include text for richer results
|
||||
highlights: true,
|
||||
};
|
||||
|
||||
if (params.include_domains?.length) {
|
||||
@@ -267,7 +265,7 @@ export async function searchExa(params: ExaSearchParams): Promise<WebSearchRespo
|
||||
args.end_published_date = params.end_published_date;
|
||||
}
|
||||
|
||||
const response = await callExaMCP(apiKey, "web_search", args);
|
||||
const response = await callExaMCP(apiKey, "web_search_exa", args);
|
||||
|
||||
if (response.error) {
|
||||
throw new Error(`Exa MCP error: ${response.error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user