ComposioHQ/composio · warning · Error
Provide query or recipients to find an iMessage thread.
Error message
Provide query or recipients to find an iMessage thread.
What it means
The 'Find iMessage thread' tool requires at least one search criterion: either a free-text query (name, phone, email, title) or a recipients array. Passing neither (undefined query and empty/missing recipients) is rejected before any scanning work is done.
Source
Thrown at ts/packages/cli-local-tools/src/toolkits/beeper-imessage.ts:934
inputParams: listThreadsInput,
execute: async (input, context) => {
const raw = await runImessageCli('threads', withCursorArgs(input, []), input, context);
return compactThreadsResult(raw, {
compact: input.compact,
includeRaw: input.includeRaw,
resolveContactNames: input.resolveContactNames,
});
},
}),
nativeTool({
slug: 'FIND_THREAD',
name: 'Find iMessage thread',
description:
'Find threads by contact name, phone/email, thread title, or participants without doing a manual LIST_THREADS pagination/filter dance.',
inputParams: findThreadInput,
execute: async (input, context) => {
if (!input.query && (!input.recipients || input.recipients.length === 0)) {
throw new Error('Provide query or recipients to find an iMessage thread.');
}
const scan = await scanThreads({
input,
context,
query: input.query,
recipients: input.recipients,
maxPages: input.maxPages,
resolveContactNames: input.resolveContactNames,
});
const result = {
items: input.compact
? scan.matches.map(thread => compactThread(thread, scan.labels))
: scan.matches,
pageInfo: {
pagesScanned: scan.pagesScanned,
hasMore: scan.hasMore,
nextBefore: scan.nextBefore,
},View on GitHub (pinned to 64b1b85502)
Solutions
- Pass a non-empty query string (contact name, phone, email, or title)
- Or pass a non-empty recipients array
- Validate user input before invoking the tool so at least one criterion exists
Example fix
// before
findThread({});
// after
findThread({ query: 'Alice' });
// or
findThread({ recipients: ['+15551234567'] }); Defensive patterns
Strategy: validation
Validate before calling
const hasCriterion = Boolean(query?.trim()) || (recipients?.length ?? 0) > 0; if (!hasCriterion) promptUserForQuery();
Type guard
const hasSearchCriterion = (i: { query?: string; recipients?: string[] }) =>
Boolean(i.query?.trim()) || (i.recipients?.length ?? 0) > 0; Try / catch
try { ... } catch (e) { if (e.message.includes('Provide query or recipients')) askUserForCriterion(); } Prevention
- Require at least one search input in your UI before invoking the tool
- Treat empty-string query as absent
When it happens
Trigger: Calling find_thread with an empty object, with query: '' and no recipients, or with recipients: []; LLM tool calls omitting all optional-looking fields.
Common situations: Optional-parameter confusion — both fields look optional so callers pass neither; empty-string queries after trimming user input.
Related errors
- Use only one of before or after.
- Invalid arguments for local tool ${resolution.finalSlug}: ${
- Could not determine a home directory to store the Composio c
- Cache directory {directory} is not writable please provide a
- module {__name__!r} has no attribute {name!r}
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/94e2dca447926f6e.
Report an issue: GitHub.