diff --git a/src/tools/search.ts b/src/tools/search.ts index f3c8cd0..ef5b960 100644 --- a/src/tools/search.ts +++ b/src/tools/search.ts @@ -16,16 +16,18 @@ export const searchTool = { filterStructureIds?: string[]; }) => { try { + // Use the first spaceId — the /lookup endpoint takes a single spaceId + const spaceId = args.spaceIds[0]; + const requestBody = { searchTerm: args.searchTerm, - spaceIds: args.spaceIds, - ...(args.mode && { mode: args.mode }), + spaceId, ...(args.filterStructureIds && { filterStructureIds: args.filterStructureIds, }), }; - const response = await makeApiRequest("/search", { + const response = await makeApiRequest("/lookup", { method: "POST", body: JSON.stringify(requestBody), });