Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

Find any Composio app by its name, not only the top 120 (#568)

Oleksandr Ivanchenko1e508345b61c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 06bbae98..d5ca9eac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## Unreleased
+### Fixed
+- **Find any Composio app by its name.** Apps & accounts › Another app only searched Composio's 120 most popular apps, so "ElevenLabs" said "No Composio apps match". Now a name the popular list doesn't have is checked with Composio itself, through Composio Connect, or on the app's public page on composio.dev when Connect can't answer (only the app's name is sent). "ElevenLabs", "elevenlabs" and "Eleven Labs" all find ElevenLabs, ready to connect. When nothing is found, the line says why and what to try: the app's full name, trying again if Composio couldn't be reached, or asking a bot. Answers are kept for 10 minutes.
+
## [Mac 0.9.6] - 2026-11-13
kwant 0.9.6: a team suggested from your own words, an Inbox that shows what your bots finished while you were away, bots that carry on or ask you when they stop, one Settings card that says if you're on the latest version and a Chrome that sites see as normal Chrome, with a window for Google sign-ins.
diff --git a/docs/connections.md b/docs/connections.md
index 45988e0e..e3556cfa 100644
--- a/docs/connections.md
+++ b/docs/connections.md
@@ -272,7 +272,9 @@ per-bot opt-outs, testing and removing all use those routes.
These routes are person-only, refuse bot tokens, and use the person's own Composio key from the
connector's header. Before Composio is added the app list answers from kwant's bundled popular
-apps and the other routes answer `409`, both **without contacting Composio**; added without a key,
+apps, and a search they barely match only checks `HEAD https://composio.dev/toolkits/<slug>` (no
+key, at most 3 slugs, 3 s, cached 10 min); the other routes answer `409` **without contacting
+Composio**; added without a key,
they answer `409`. The key is never echoed or logged. `KWNT_COMPOSIO_API_URL` points them at
another API address and `KWNT_COMPOSIO_CONNECT_URL` at another Composio Connect (tests).
diff --git a/frontend/src/components/ConnectionsView.tsx b/frontend/src/components/ConnectionsView.tsx
index e5a3e121..b8255450 100644
--- a/frontend/src/components/ConnectionsView.tsx
+++ b/frontend/src/components/ConnectionsView.tsx
@@ -191,7 +191,7 @@ export const ConnectionRow: React.FC<ConnectionRowProps> = ({ c, now = Date.now(
};
export interface ComposioSearchApi {
- search: (q: string) => Promise<{ apps: ComposioApp[]; can_connect: boolean }>;
+ search: (q: string) => Promise<{ apps: ComposioApp[]; can_connect: boolean; hint?: string }>;
connect: (slug: string) => Promise<{ redirect_url: string }>;
}
@@ -209,6 +209,8 @@ export const ComposioAppSearch: React.FC<{
const id = useId();
const [q, setQ] = useState('');
const [apps, setApps] = useState<ComposioApp[] | null>(initialApps ?? null);
+ /** The server's line for a search with no apps (what to try next). */
+ const [hint, setHint] = useState<string | null>(null);
const [busy, setBusy] = useState(false);
const [connecting, setConnecting] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
@@ -231,7 +233,9 @@ export const ComposioAppSearch: React.FC<{
setError(null);
setOpened(null);
try {
- setApps((await api.search(query)).apps);
+ const found = await api.search(query);
+ setApps(found.apps);
+ setHint(found.hint ?? null);
} catch (err) {
setError(errorText(err));
} finally {
@@ -294,7 +298,7 @@ export const ComposioAppSearch: React.FC<{
Opened {opened}’s sign-in on Composio in {inDesktopApp() ? 'your browser' : 'a new tab'}. Its tools reach your bots through the Composio server once you finish there.
</p>
)}
- {apps && apps.length === 0 && <p className="text-xs text-zinc-400">No Composio apps match.</p>}
+ {apps && apps.length === 0 && <p className="text-xs text-zinc-400" data-composio-search="none">{hint ?? 'No Composio apps match.'}</p>}
</div>
{apps && apps.length > 0 && (
<ul className="divide-y divide-zinc-800 rounded-lg border border-zinc-800" aria-label="Composio apps">
diff --git a/frontend/src/connections.ts b/frontend/src/connections.ts
index 3268b156..8a7448d4 100644
--- a/frontend/src/connections.ts
+++ b/frontend/src/connections.ts
@@ -245,7 +245,7 @@ export const connectionsApi = {
call<{ server?: { id: string } }>('/api/mcp/registry/install', 'POST', { registry_name: registryName, name, env, headers }),
/** Searches Composio's apps with the person's own Composio key (only once Composio is added). */
searchComposioApps: (q: string) =>
- call<{ apps: ComposioApp[]; can_connect: boolean; warning: string }>(`/api/connections/composio/apps?q=${enc(q)}`),
+ call<{ apps: ComposioApp[]; can_connect: boolean; warning: string; hint?: string }>(`/api/connections/composio/apps?q=${enc(q)}`),
/** Starts signing in to one Composio app; the answer is the address to open. */
connectComposioApp: (slug: string) =>
call<{ redirect_url: string; warning: string }>(`/api/connections/composio/apps/${enc(slug)}/connect`, 'POST'),
diff --git a/src/mcp/composio.rs b/src/mcp/composio.rs
index 0456ddc2..8851eb90 100644
--- a/src/mcp/composio.rs
+++ b/src/mcp/composio.rs
@@ -49,6 +49,18 @@ pub const MANAGE_TOOL: &str = "COMPOSIO_MANAGE_CONNECTIONS";
const CONNECT_TIMEOUT_SECS: i64 = 15;
/// Most apps one `list` call asks about.
pub const MAX_STATUS_SLUGS: usize = 120;
+/// The Composio Connect tool kwnt asks whether an app exists, by the name the person typed.
+/// (`COMPOSIO_MANAGE_CONNECTIONS` `list` can't tell: it answers "initiated" for a made-up app too;
+/// checked 2026-11-13.)
+pub const SEARCH_TOOL: &str = "COMPOSIO_SEARCH_TOOLS";
+/// Composio's public app pages: `<this>/<slug>` answers 200 for an app Composio has and 404 for
+/// one it hasn't (checked 2026-11-13: elevenlabs 200, google_search_console 200, notarealapp123
+/// 404). kwnt asks with `HEAD`, no key and nothing about the person: only the app's slug.
+pub const TOOLKITS_PAGE_URL: &str = "https://composio.dev/toolkits";
+/// How long one app page check may take.
+const PAGE_CHECK_TIMEOUT: Duration = Duration::from_secs(3);
+/// Most app names one search asks Composio about.
+pub const MAX_CANDIDATES: usize = 3;
/// Which kind of Composio key, from its prefix.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -94,17 +106,23 @@ pub fn popular_apps() -> &'static [PopularApp] {
})
}
+/// Whether `app`'s name, one of its name's words, or its slug starts with `query` (as typed,
+/// trimmed, any case): the person is likely still typing that app's name.
+pub fn popular_starts_with(app: &PopularApp, query: &str) -> bool {
+ let q = query.trim().to_lowercase();
+ let name = app.name.to_lowercase();
+ name.starts_with(&q) || app.slug.starts_with(&q) || name.split(' ').any(|w| w.starts_with(&q))
+}
+
/// Popular apps matching `query` (name or slug, any case): those starting with it first, then
/// those containing it, each in popularity order; at most `limit`.
pub fn search_popular(query: &str, limit: usize) -> Vec<&'static PopularApp> {
let q = query.trim().to_lowercase();
- let words = |a: &PopularApp| (a.name.to_lowercase(), a.slug.clone());
let (mut first, mut then) = (Vec::new(), Vec::new());
for a in popular_apps() {
- let (name, slug) = words(a);
- if name.starts_with(&q) || slug.starts_with(&q) || name.split(' ').any(|w| w.starts_with(&q)) {
+ if popular_starts_with(a, &q) {
first.push(a);
- } else if name.contains(&q) || slug.contains(&q) {
+ } else if a.name.to_lowercase().contains(&q) || a.slug.contains(&q) {
then.push(a);
}
}
@@ -113,6 +131,86 @@ pub fn search_popular(query: &str, limit: usize) -> Vec<&'static PopularApp> {
first
}
+/// The slugs an app the person typed by name could have, most likely first, at most
+/// [`MAX_CANDIDATES`]: "ElevenLabs" and "elevenlabs" → `elevenlabs`; "Eleven Labs" →
+/// `elevenlabs`, `eleven_labs`, `eleven-labs`. None for a name with letters outside ASCII (no
+/// Composio slug has them) or under two characters.
+pub fn slug_candidates(query: &str) -> Vec<String> {
+ if query.chars().any(|c| c.is_alphanumeric() && !c.is_ascii()) {
+ return vec![];
+ }
+ let words: Vec<String> = query
+ .split(|c: char| !c.is_ascii_alphanumeric())
+ .filter(|w| !w.is_empty())
+ .map(str::to_ascii_lowercase)
+ .collect();
+ let compact = words.concat();
+ if compact.len() < 2 {
+ return vec![];
+ }
+ let mut out = vec![compact];
+ if words.len() > 1 {
+ out.push(words.join("_"));
+ out.push(words.join("-"));
+ }
+ out.retain(|s| valid_slug(s));
+ out.dedup();
+ out.truncate(MAX_CANDIDATES);
+ out
+}
+
+/// An app Composio Connect's search named that is one of the slugs kwnt asked about.
+#[derive(Debug, Clone, PartialEq)]
+pub struct FoundApp {
+ pub slug: String,
+ pub description: Option<String>,
+ /// Whether the person has a working account for it, when the answer says.
+ pub connected: Option<bool>,
+}
+
+/// The apps among `candidates` that a `COMPOSIO_SEARCH_TOOLS` answer names, in `candidates`
+/// order. Only exact slugs count: the search always answers with something ("notarealapp123"
+/// gets Google and a design tool), so a looser match would offer apps the person didn't type.
+/// Nothing else in the answer (accounts, the person's details, tool schemas) is kept.
+pub fn found_toolkits(text: &str, candidates: &[String]) -> Result<Vec<FoundApp>, ComposioError> {
+ let body: Value = serde_json::from_str(text.trim())
+ .map_err(|_| ComposioError::Upstream(200, "Composio Connect answered something kwant can't read".into()))?;
+ if body["successful"] == json!(false) || body["success"] == json!(false) {
+ let why = body["error"].as_str().or_else(|| body["data"]["message"].as_str()).unwrap_or_default();
+ return Err(ComposioError::Upstream(200, clip(why, 200)));
+ }
+ let data = if body["data"].is_object() { &body["data"] } else { &body };
+ let mut named: BTreeSet<String> = BTreeSet::new();
+ for r in data["results"].as_array().into_iter().flatten() {
+ for t in r["toolkits"].as_array().into_iter().flatten() {
+ if let Some(t) = t.as_str() {
+ named.insert(t.to_ascii_lowercase());
+ }
+ }
+ }
+ let statuses: Vec<&Value> = data["toolkit_connection_statuses"].as_array().into_iter().flatten().collect();
+ for s in &statuses {
+ if let Some(t) = s["toolkit"].as_str() {
+ named.insert(t.to_ascii_lowercase());
+ }
+ }
+ Ok(candidates
+ .iter()
+ .filter(|c| named.contains(c.as_str()))
+ .map(|c| {
+ let status = statuses.iter().find(|s| s["toolkit"].as_str().is_some_and(|t| t.eq_ignore_ascii_case(c)));
+ FoundApp {
+ slug: c.clone(),
+ description: status
+ .and_then(|s| s["description"].as_str())
+ .map(|d| clip(d.trim(), 240))
+ .filter(|d| !d.is_empty()),
+ connected: status.and_then(|s| s["has_active_connection"].as_bool()),
+ }
+ })
+ .collect())
+}
+
/// The `results` of a `COMPOSIO_MANAGE_CONNECTIONS` answer (`{"successful", "data": {"results":
/// {<slug>: …}}}`), or why there are none.
pub fn manage_results(text: &str) -> Result<Value, ComposioError> {
@@ -289,6 +387,8 @@ pub struct ComposioApi {
base_url: String,
/// Composio Connect's MCP address, for `ck_` keys.
connect_url: String,
+ /// Composio's public app pages, for the keyless check.
+ toolkits_url: String,
client: reqwest::Client,
}
@@ -374,9 +474,12 @@ impl ComposioApi {
/// else `<base_url>/connect/mcp`, so a fake Composio serves both.
pub fn new(base_url: &str) -> Self {
let base_url = base_url.trim_end_matches('/').to_string();
- let connect_url = if base_url == DEFAULT_API_URL { CONNECT_MCP_URL.to_string() } else { format!("{base_url}/connect/mcp") };
+ let ours = base_url == DEFAULT_API_URL;
+ let connect_url = if ours { CONNECT_MCP_URL.to_string() } else { format!("{base_url}/connect/mcp") };
+ let toolkits_url = if ours { TOOLKITS_PAGE_URL.to_string() } else { format!("{base_url}/toolkits") };
Self {
connect_url,
+ toolkits_url,
base_url,
client: reqwest::Client::builder()
.timeout(TIMEOUT)
@@ -436,16 +539,51 @@ impl ComposioApi {
Ok(tools)
}
- /// One `COMPOSIO_MANAGE_CONNECTIONS` call on Composio Connect; its `results`.
- async fn manage(&self, key: &str, toolkits: Value) -> Result<Value, ComposioError> {
+ /// One tool call on Composio Connect; the answer's text.
+ async fn connect_call(&self, key: &str, tool: &str, arguments: Value) -> Result<String, ComposioError> {
let mut client = McpClient::connect(&self.connect_server(key), None).await.map_err(connect_error)?;
- let result = client.call_tool(MANAGE_TOOL, json!({"toolkits": toolkits})).await.map_err(connect_error);
+ let result = client.call_tool(tool, arguments).await.map_err(connect_error);
client.shutdown().await;
let result = result?;
if result.is_error {
return Err(ComposioError::Upstream(200, clip(&result.text, 200)));
}
- manage_results(&result.text)
+ Ok(result.text)
+ }
+
+ /// One `COMPOSIO_MANAGE_CONNECTIONS` call on Composio Connect; its `results`.
+ async fn manage(&self, key: &str, toolkits: Value) -> Result<Value, ComposioError> {
+ manage_results(&self.connect_call(key, MANAGE_TOOL, json!({"toolkits": toolkits})).await?)
+ }
+
+ /// Which of `candidates` are apps Composio has, from one `COMPOSIO_SEARCH_TOOLS` call on
+ /// Composio Connect with the name the person typed (no side effects: it finds tools, it runs
+ /// none). See [`found_toolkits`].
+ pub async fn connect_find_apps(&self, key: &str, query: &str, candidates: &[String]) -> Result<Vec<FoundApp>, ComposioError> {
+ if candidates.is_empty() {
+ return Ok(vec![]);
+ }
+ let args = json!({
+ "queries": [{"use_case": clip(query.trim(), MAX_QUERY_CHARS)}],
+ "session": {"generate_id": true},
+ });
+ found_toolkits(&self.connect_call(key, SEARCH_TOOL, args).await?, candidates)
+ }
+
+ /// Whether Composio has an app with this exact slug, from its public app page: `Some(true)`
+ /// for 2xx, `Some(false)` for 404 or 410, `None` when it can't be told (a timeout, another
+ /// status, a redirect). No key and no cookies go with it; it never follows a redirect.
+ pub async fn toolkit_page_exists(&self, slug: &str) -> Option<bool> {
+ if !valid_slug(slug) {
+ return Some(false);
+ }
+ let url = format!("{}/{slug}", self.toolkits_url.trim_end_matches('/'));
+ let res = self.client.head(url).timeout(PAGE_CHECK_TIMEOUT).send().await.ok()?;
+ match res.status().as_u16() {
+ 200..=299 => Some(true),
+ 404 | 410 => Some(false),
+ _ => None,
+ }
}
/// Starts signing in to the app `slug` through Composio Connect (`add`): the address the
@@ -678,6 +816,53 @@ impl ComposioApi {
mod tests {
use super::*;
+ #[test]
+ fn a_typed_name_gives_at_most_three_slugs() {
+ for q in ["ElevenLabs", "elevenlabs", " ELEVENLABS "] {
+ assert_eq!(slug_candidates(q), vec!["elevenlabs"], "{q}");
+ }
+ assert_eq!(slug_candidates("Eleven Labs"), vec!["elevenlabs", "eleven_labs", "eleven-labs"]);
+ assert_eq!(slug_candidates("Google Search-Console"), vec!["googlesearchconsole", "google_search_console", "google-search-console"]);
+ assert_eq!(slug_candidates("x.com!"), vec!["xcom", "x_com", "x-com"]);
+ for none in ["", "a", "?!", "Café", "日本"] {
+ assert!(slug_candidates(none).is_empty(), "{none}");
+ }
+ assert!(slug_candidates(&"word ".repeat(30)).iter().all(|s| valid_slug(s)), "too long ones are left out");
+ }
+
+ fn recorded(name: &str) -> String {
+ std::fs::read_to_string(format!("{}/tests/fixtures/composio/{name}", env!("CARGO_MANIFEST_DIR"))).unwrap()
+ }
+
+ #[test]
+ fn composio_search_finds_only_the_slugs_asked_about() {
+ let el = |q: &str| slug_candidates(q);
+ let found = found_toolkits(&recorded("search_tools_elevenlabs.json"), &el("ElevenLabs")).unwrap();
+ assert_eq!(found.len(), 1);
+ assert_eq!(found[0].slug, "elevenlabs");
+ assert_eq!(found[0].connected, Some(true));
+ assert!(found[0].description.as_deref().unwrap().starts_with("Create natural AI voices"));
+ assert!(!format!("{found:?}").contains("redacted"), "nothing about the person's accounts is kept: {found:?}");
+ let found = found_toolkits(&recorded("search_tools_eleven_labs.json"), &el("Eleven Labs")).unwrap();
+ assert_eq!(found.iter().map(|f| f.slug.as_str()).collect::<Vec<_>>(), vec!["elevenlabs"]);
+ // A made-up name still gets apps back (Google, a design tool): none of them is the one typed.
+ let text = recorded("search_tools_notarealapp123.json");
+ assert!(text.contains("googlesuper"));
+ assert_eq!(found_toolkits(&text, &el("notarealapp123")).unwrap(), vec![]);
+ // A failed search is an error, not "no such app".
+ assert!(found_toolkits(r#"{"successful": false, "error": "rate limited"}"#, &el("x y")).is_err());
+ assert!(found_toolkits("not json", &el("x y")).is_err());
+ }
+
+ #[test]
+ fn manage_list_cannot_tell_a_real_app_from_a_made_up_one() {
+ // Why kwant asks COMPOSIO_SEARCH_TOOLS instead: heygen is real, notarealapp123 isn't, and
+ // `list` answers both the same.
+ let results = manage_results(&recorded("manage_list_real_and_made_up.json")).unwrap();
+ assert!(result_active(&results["elevenlabs"]));
+ assert_eq!(results["heygen"]["status"], results["notarealapp123"]["status"]);
+ }
+
#[test]
fn slugs_are_plain_lowercase_words() {
assert!(valid_slug("gmail") && valid_slug("google_drive") && valid_slug("x-twitter"));
diff --git a/src/server/connections.rs b/src/server/connections.rs
index cd09ff21..b845098f 100644
--- a/src/server/connections.rs
+++ b/src/server/connections.rs
@@ -1166,7 +1166,7 @@ async fn composio_with_key(state: &AppState, space: &SpaceId) -> Result<(Composi
let Some(setup) = composio_setup(state, space).await else {
return Err(error_with(
StatusCode::CONFLICT,
- "Add Composio first: paste your free Composio API key in Apps & accounts. kwant never contacts Composio before that.",
+ "Add Composio first: paste your free Composio API key in Apps & accounts. Until then, kwant only looks up app names you search for on composio.dev, with no key or account details.",
"add_composio",
));
};
@@ -1203,23 +1203,195 @@ fn popular_rows<'a>(apps: impl Iterator<Item = &'a composio::PopularApp>, connec
.collect()
}
-/// Before Composio is added: Composio's popular apps from kwant itself, no Composio call.
-fn popular_before_setup(q: Option<&str>) -> Response {
+/// Before Composio is added: Composio's popular apps from kwant itself, no Composio API call.
+/// A typed name the popular list doesn't have is checked against Composio's public app pages
+/// (see [`apps_by_name`]): the app's slug only, no key.
+async fn popular_before_setup(state: &AppState, q: Option<&str>) -> Response {
let apps: Vec<&composio::PopularApp> = match q {
Some(q) => composio::search_popular(q, SEARCH_POPULAR_LIMIT),
None => composio::popular_apps().iter().collect(),
};
- let count = apps.len();
- Json(json!({
- "apps": popular_rows(apps.into_iter(), None),
+ let by_name = match q {
+ Some(q) => apps_by_name(state, q, &apps, None).await,
+ None => ByName::default(),
+ };
+ let mut rows = popular_rows(apps.into_iter(), None);
+ rows.extend(by_name.rows);
+ let count = rows.len();
+ let mut body = json!({
+ "apps": rows,
"count": count,
"connected_checked": false,
"mode": Value::Null,
"can_connect": false,
"source": "popular",
"warning": COMPOSIO_WARNING,
- }))
- .into_response()
+ });
+ add_hint(&mut body, q, by_name.asked);
+ Json(body).into_response()
+}
+
+// Apps by name. The popular list is Composio's top 120 apps; Composio has many more, and a
+// Composio Connect key can't list them. When the list barely matches what the person typed, kwant
+// asks about the name itself: its slug candidates (`composio::slug_candidates`, at most 3), first
+// with Composio Connect's search when there's a Connect key, else (or when that can't answer)
+// Composio's public app page for each. Answers are kept a while, so typing the same name again
+// costs nothing.
+
+/// Fewer popular matches than this, none of them the typed name itself and none starting with
+/// it: ask about the name.
+const FEW_POPULAR: usize = 3;
+/// How long one name's answer is kept.
+const BY_NAME_TTL: std::time::Duration = std::time::Duration::from_secs(10 * 60);
+/// The most a search waits for Composio Connect's answer about a name.
+const BY_NAME_CONNECT_BUDGET: std::time::Duration = std::time::Duration::from_secs(6);
+
+/// Answers about names, by source and slug candidates: when, and the apps found.
+type ByNameSeen = HashMap<String, (std::time::Instant, Vec<composio::FoundApp>)>;
+
+fn by_name_seen() -> &'static Mutex<ByNameSeen> {
+ static SEEN: OnceLock<Mutex<ByNameSeen>> = OnceLock::new();
+ SEEN.get_or_init(Default::default)
+}
+
+#[derive(Default)]
+struct ByName {
+ /// Rows for apps found by name, after the popular matches.
+ rows: Vec<Value>,
+ /// Composio was asked about the name and answered (even with nothing).
+ asked: bool,
+}
+
+/// The name an app found by name is shown with: what the person typed when it is the slug in
+/// other case ("ElevenLabs"), else a known name, else the slug in words.
+fn typed_name(q: &str, slug: &str) -> String {
+ let q = q.split_whitespace().collect::<Vec<_>>().join(" ");
+ let compact: String = q.chars().filter(|c| c.is_ascii_alphanumeric()).collect::<String>().to_ascii_lowercase();
+ let known = app_names().lock().unwrap_or_else(|e| e.into_inner()).get(slug).cloned();
+ match known {
+ Some(n) => n,
+ None if compact == slug.replace(['_', '-'], "") && q.chars().any(|c| c.is_ascii_uppercase()) && q.chars().count() <= 60 => q,
+ None => app_name(slug),
+ }
+}
+
+/// Apps called `q` that the popular matches `popular` don't show, as rows. `key` is a Composio
+/// Connect key, or `None` before Composio is added.
+async fn apps_by_name(state: &AppState, q: &str, popular: &[&composio::PopularApp], key: Option<&str>) -> ByName {
+ let candidates = composio::slug_candidates(q);
+ if candidates.is_empty() || popular.iter().any(|a| candidates.contains(&a.slug)) {
+ return ByName::default();
+ }
+ // A popular app typed another way ("google-calendar", "Google Calendar"): no call needed.
+ let bundled: Vec<&composio::PopularApp> = candidates
+ .iter()
+ .filter_map(|c| composio::popular_apps().iter().find(|a| &a.slug == c))
+ .collect();
+ if !bundled.is_empty() {
+ return ByName { rows: popular_rows(bundled.into_iter(), None), asked: false };
+ }
+ // Enough popular matches, or a popular app's name still being typed ("gma" → Gmail): no call.
+ if popular.len() >= FEW_POPULAR || popular.iter().any(|a| composio::popular_starts_with(a, q)) {
+ return ByName::default();
+ }
+ let ck = format!(
+ "{:p}:{}:{}",
+ Arc::as_ptr(&state.composio_api),
+ key.map(|k| format!("{:x}", fingerprint(k, ""))).unwrap_or_default(),
+ candidates.join(",")
+ );
+ let cached = {
+ let mut seen = by_name_seen().lock().unwrap_or_else(|e| e.into_inner());
+ seen.retain(|_, (at, _)| at.elapsed() < BY_NAME_TTL);
+ if seen.len() > 1000 {
+ seen.clear();
+ }
+ seen.get(&ck).map(|(_, found)| found.clone())
+ };
+ let found = match cached {
+ Some(found) => Some(found),
+ None => {
+ let found = find_by_name(state, q, &candidates, key).await;
+ if let Some(f) = &found {
+ by_name_seen().lock().unwrap_or_else(|e| e.into_inner()).insert(ck, (std::time::Instant::now(), f.clone()));
+ }
+ found
+ }
+ };
+ let Some(found) = found else {
+ return ByName::default();
+ };
+ let rows = found
+ .iter()
+ .map(|f| {
+ let name = typed_name(q, &f.slug);
+ app_names().lock().unwrap_or_else(|e| e.into_inner()).entry(f.slug.clone()).or_insert_with(|| name.clone());
+ let mut row = json!({
+ "slug": f.slug,
+ "name": name,
+ "logo": format!("https://logos.composio.dev/api/{}", f.slug),
+ "connected": f.connected.unwrap_or(false),
+ "found_by_name": true,
+ });
+ if let Some(d) = &f.description {
+ row["description"] = json!(d);
+ }
+ row
+ })
+ .collect();
+ ByName { rows, asked: true }
+}
+
+/// Asks Composio which of `candidates` exist: Composio Connect's search with `key`, else (or when
+/// it can't answer or finds none of them) each candidate's public app page. `None` when neither
+/// could say.
+async fn find_by_name(state: &AppState, q: &str, candidates: &[String], key: Option<&str>) -> Option<Vec<composio::FoundApp>> {
+ let started = std::time::Instant::now();
+ let mut answered = false;
+ if let Some(key) = key {
+ match tokio::time::timeout(BY_NAME_CONNECT_BUDGET, state.composio_api.connect_find_apps(key, q, candidates)).await {
+ Ok(Ok(found)) if !found.is_empty() => {
+ tracing::debug!(found = found.len(), ms = started.elapsed().as_millis() as u64, "connections: Composio Connect found apps by name");
+ return Some(found);
+ }
+ Ok(Ok(_)) => answered = true,
+ Ok(Err(e)) => tracing::warn!(error = %e.message(), "connections: Composio Connect couldn't search for an app by name"),
+ Err(_) => tracing::warn!("connections: Composio Connect took too long to search for an app by name"),
+ }
+ }
+ let checks = futures::future::join_all(candidates.iter().map(|c| state.composio_api.toolkit_page_exists(c))).await;
+ answered |= checks.iter().any(Option::is_some);
+ let found: Vec<composio::FoundApp> = candidates
+ .iter()
+ .zip(checks)
+ .filter(|(_, exists)| *exists == Some(true))
+ .map(|(c, _)| composio::FoundApp { slug: c.clone(), description: None, connected: None })
+ .take(1)
+ .collect();
+ tracing::debug!(found = found.len(), ms = started.elapsed().as_millis() as u64, "connections: Composio app pages checked by name");
+ (answered || !found.is_empty()).then_some(found)
+}
+
+/// The line a search with no apps shows: (a) Composio answered with nothing, (b) Composio
+/// couldn't be reached, (c) no name to check (non-Latin letters, one character). Words: Mira (Nov 13).
+fn no_apps_hint(q: &str, asked: bool) -> String {
+ let q: String = q.split_whitespace().collect::<Vec<_>>().join(" ");
+ if asked {
+ format!("kwant couldn't find an app called “{q}” on Composio. Check the spelling or type the app's full name, or ask a bot to connect it.")
+ } else if composio::slug_candidates(&q).is_empty() {
+ format!("No app called “{q}” in Composio's top apps. Type the app's full name in English letters, or ask a bot to connect it.")
+ } else {
+ format!("“{q}” isn't one of Composio's top apps, and kwant couldn't reach Composio to check the rest. Try again in a minute, or ask a bot to connect it.")
+ }
+}
+
+/// Adds `hint` to a search answer with no apps.
+fn add_hint(body: &mut Value, q: Option<&str>, asked: bool) {
+ if let Some(q) = q {
+ if body["apps"].as_array().is_some_and(|a| a.is_empty()) {
+ body["hint"] = json!(no_apps_hint(q, asked));
+ }
+ }
}
/// At most this many popular apps answer a search; their status is one Composio call.
@@ -1270,7 +1442,8 @@ async fn connect_search_status(state: &AppState, space: &SpaceId, key: &str, slu
}
/// With a Composio Connect key: Composio's popular apps (Composio Connect has no catalogue
-/// call), each with `connected`.
+/// call), each with `connected`, and for a search, apps found by the typed name after them
+/// (`found_by_name`).
async fn connect_popular(state: &AppState, space: &SpaceId, setup: &ComposioSetup, key: &str, q: Option<&str>) -> Response {
let (apps, connected) = match q {
None => {
@@ -1280,8 +1453,22 @@ async fn connect_popular(state: &AppState, space: &SpaceId, setup: &ComposioSetu
Some(q) => {
let apps = composio::search_popular(q, SEARCH_POPULAR_LIMIT);
let slugs: Vec<&str> = apps.iter().map(|a| a.slug.as_str()).collect();
- let connected = connect_search_status(state, space, key, &slugs).await;
- (apps, connected)
+ // The popular matches' status and the name lookup are separate Composio Connect calls.
+ let (connected, by_name) = tokio::join!(connect_search_status(state, space, key, &slugs), apps_by_name(state, q, &apps, Some(key)));
+ let mut rows = popular_rows(apps.into_iter(), connected.as_ref());
+ rows.extend(by_name.rows);
+ let count = rows.len();
+ let mut body = json!({
+ "apps": rows,
+ "count": count,
+ "connected_checked": connected.is_some(),
+ "mode": "connect",
+ "can_connect": true,
+ "source": "popular",
+ "warning": COMPOSIO_WARNING,
+ });
+ add_hint(&mut body, Some(q), by_name.asked);
+ return Json(body).into_response();
}
};
let count = apps.len();
@@ -1456,8 +1643,10 @@ async fn list_composio_apps(state: &AppState, headers: &HeaderMap, space: &Space
/// searched with the person's own Composio key, each with `connected` for the space's Composio
/// user (one account call per search). `source` says where the apps come from: `"all"` is
/// Composio's catalogue (a project key); `"popular"` is Composio's top apps bundled with kwant,
-/// served before Composio is added (no Composio call, `mode: null`) and with a Composio Connect
-/// key. 409 when Composio is added without a key.
+/// served before Composio is added (no Composio API call, `mode: null`) and with a Composio Connect
+/// key; a search there also asks about the typed name (rows with `found_by_name: true`, after the
+/// popular ones). A search with no apps carries `hint`, the line to show. 409 when Composio is
+/// added without a key.
pub async fn search_composio_apps(
State(state): State<AppState>,
headers: HeaderMap,
@@ -1472,7 +1661,7 @@ pub async fn search_composio_apps(
return error(StatusCode::BAD_REQUEST, "type an app name, up to 60 characters");
}
if composio_setup(&state, &space).await.is_none() {
- return popular_before_setup(q);
+ return popular_before_setup(&state, q).await;
}
let (setup, key) = match composio_with_key(&state, &space).await {
Ok(found) => found,
@@ -1507,15 +1696,17 @@ pub async fn search_composio_apps(
row
})
.collect();
- Json(json!({
+ let mut body = json!({
"apps": rows,
"connected_checked": connected.is_some(),
"mode": setup.mode(),
"can_connect": user.is_some(),
"source": "all",
"warning": COMPOSIO_WARNING,
- }))
- .into_response()
+ });
+ // Composio answered from its whole catalogue: line (a).
+ add_hint(&mut body, Some(q), true);
+ Json(body).into_response()
}
/// `POST /api/connections/composio/apps/:slug/connect?space=`: starts signing in to one app on
@@ -1600,6 +1791,24 @@ pub async fn composio_app_status(
mod tests {
use super::*;
+ #[test]
+ fn no_apps_hint_says_why_nothing_was_found() {
+ assert_eq!(
+ no_apps_hint(" Search Console ", true),
+ "kwant couldn't find an app called “Search Console” on Composio. Check the spelling or type the app's full name, or ask a bot to connect it."
+ );
+ assert_eq!(
+ no_apps_hint("Eleven Labs", false),
+ "“Eleven Labs” isn't one of Composio's top apps, and kwant couldn't reach Composio to check the rest. Try again in a minute, or ask a bot to connect it."
+ );
+ for q in ["Почта", "x", "!!"] {
+ assert_eq!(
+ no_apps_hint(q, false),
+ format!("No app called “{q}” in Composio's top apps. Type the app's full name in English letters, or ask a bot to connect it.")
+ );
+ }
+ }
+
fn server(enabled: bool, url: Option<&str>) -> McpServer {
McpServer {
id: "s1".into(),
diff --git a/tests/composio_one_key_test.rs b/tests/composio_one_key_test.rs
index ed3cd484..aa88a306 100644
--- a/tests/composio_one_key_test.rs
+++ b/tests/composio_one_key_test.rs
@@ -69,6 +69,7 @@ async fn fake_connect(State(f): State<Shared>, h: HeaderMap, Json(body): Json<Va
let method = body["method"].as_str().unwrap_or_default().to_string();
let args = body["params"]["arguments"].clone();
let what = match method.as_str() {
+ "tools/call" if body["params"]["name"] == "COMPOSIO_SEARCH_TOOLS" => "/connect/mcp tools/call search".to_string(),
"tools/call" => format!("/connect/mcp tools/call {}", args["toolkits"][0]["action"].as_str().unwrap_or_default()),
m => format!("/connect/mcp {m}"),
};
@@ -107,6 +108,18 @@ async fn fake_connect(State(f): State<Shared>, h: HeaderMap, Json(body): Json<Va
let text = json!({"successful": true, "data": {"results": results}, "error": null}).to_string();
json!({"content": [{"type": "text", "text": text}], "isError": false})
}
+ // Composio's recorded answers (tests/fixtures/composio): ElevenLabs typed any way, and a
+ // made-up name, which still gets unrelated toolkits back.
+ "tools/call" if body["params"]["name"] == "COMPOSIO_SEARCH_TOOLS" => {
+ let asked = args["queries"][0]["use_case"].as_str().unwrap_or_default().to_ascii_lowercase();
+ let file = match asked.as_str() {
+ "elevenlabs" => "search_tools_elevenlabs.json",
+ "eleven labs" => "search_tools_eleven_labs.json",
+ _ => "search_tools_notarealapp123.json",
+ };
+ let text = std::fs::read_to_string(format!("{}/tests/fixtures/composio/{file}", env!("CARGO_MANIFEST_DIR"))).unwrap();
+ json!({"content": [{"type": "text", "text": text}], "isError": false})
+ }
_ => json!({"content": [{"type": "text", "text": "not in this fake"}], "isError": true}),
};
let event = format!("event: message\ndata: {}\n\n", json!({"jsonrpc": "2.0", "id": id, "result": result}));
@@ -117,6 +130,15 @@ async fn fake_composio() -> (String, Shared) {
let fake: Shared = Arc::default();
let app = Router::new()
.route("/connect/mcp", post(fake_connect))
+ // composio.dev's public app pages, as recorded: elevenlabs exists, nothing else here does.
+ .route(
+ "/toolkits/:slug",
+ get(|State(f): State<Shared>, h: HeaderMap, Path(slug): Path<String>| async move {
+ let key = [key_of(&h), h.get("x-consumer-api-key").and_then(|v| v.to_str().ok()).unwrap_or_default().to_string()].concat();
+ f.lock().unwrap().seen.push(("HEAD".into(), format!("/toolkits/{slug}"), key, Value::Null));
+ if slug == "elevenlabs" { StatusCode::OK } else { StatusCode::NOT_FOUND }
+ }),
+ )
.route(
"/api/v3.1/tool_router/session",
post(|State(f): State<Shared>, h: HeaderMap, Json(body): Json<Value>| async move {
@@ -199,6 +221,10 @@ async fn fake_composio() -> (String, Shared) {
_ => (StatusCode::BAD_REQUEST, Json(json!({"error": {"message": "bad cursor"}}))),
};
}
+ // A made-up name: Composio's search answers with nothing.
+ if q.get("search").is_some_and(|s| s == "notarealapp123") {
+ return (StatusCode::OK, Json(json!({"items": []})));
+ }
(
StatusCode::OK,
Json(json!({"items": [
@@ -706,6 +732,11 @@ async fn without_a_query_the_whole_catalogue_comes_back_for_autocomplete() {
assert_eq!(s, StatusCode::BAD_REQUEST);
let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=gm", None).await;
assert_eq!((s, v["apps"].as_array().unwrap().len()), (StatusCode::OK, 3), "{v}");
+ assert!(v.get("hint").is_none(), "{v}");
+ // Nothing in the whole catalogue: Composio answered, so line (a).
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=notarealapp123", None).await;
+ assert_eq!((s, v["apps"].clone(), v["source"].clone()), (StatusCode::OK, json!([]), json!("all")), "{v}");
+ assert_eq!(v["hint"], "kwant couldn't find an app called “notarealapp123” on Composio. Check the spelling or type the app's full name, or ask a bot to connect it.");
// Another key gets its own list; a refused key gets the usual 409.
let (s, _) = call(&env.app, "PUT", "/api/connections/composio/key", Some(json!({"api_key": "ak_good2"}))).await;
@@ -937,3 +968,127 @@ async fn replacing_the_key_switches_between_project_and_composio_connect() {
let c = calls(&fake);
assert_eq!(c.iter().map(|x| x.1.as_str()).collect::<Vec<_>>(), vec!["/api/v3.1/tool_router/session"], "{c:?}");
}
+
+/// The search with a Composio Connect key: a name the popular list doesn't have is asked about
+/// with Composio Connect's search, however it is typed, and comes back with Connect.
+#[tokio::test]
+async fn composio_connect_finds_an_app_beyond_the_popular_list_by_its_name() {
+ let (env, fake) = env_with_fake().await;
+ let (s, v) = call(&env.app, "POST", "/api/connections/composio", Some(json!({"api_key": "ck_good"}))).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ calls(&fake);
+
+ for (typed, name) in [("ElevenLabs", "ElevenLabs"), ("elevenlabs", "ElevenLabs"), ("Eleven%20Labs", "ElevenLabs")] {
+ let (s, v) = call(&env.app, "GET", &format!("/api/connections/composio/apps?q={typed}"), None).await;
+ assert_eq!(s, StatusCode::OK, "{typed}: {v}");
+ let found: Vec<&Value> = v["apps"].as_array().unwrap().iter().filter(|a| a["slug"] == "elevenlabs").collect();
+ assert_eq!(found.len(), 1, "{typed}: {v}");
+ let app = found[0];
+ assert_eq!(app["name"], name, "{typed}: the name as first typed: {v}");
+ assert_eq!(app["logo"], "https://logos.composio.dev/api/elevenlabs");
+ assert_eq!(app["connected"], true, "from the search's connection status: {v}");
+ assert_eq!(app["found_by_name"], true);
+ assert!(app["description"].as_str().unwrap().contains("voices"), "{v}");
+ assert_eq!(v["can_connect"], true);
+ assert_eq!(v["count"], json!(v["apps"].as_array().unwrap().len()));
+ assert!(v.get("hint").is_none(), "{v}");
+ let c = calls(&fake);
+ let searches: Vec<&Value> = c.iter().filter(|x| x.1 == "/connect/mcp tools/call search").map(|x| &x.3).collect();
+ assert!(searches.len() <= 1, "{typed}: one search at most: {c:?}");
+ if let Some(asked) = searches.first() {
+ assert_eq!(asked["queries"][0]["use_case"], typed.replace("%20", " "), "only the typed name goes: {asked}");
+ assert!(c.iter().all(|x| x.2 == "ck_good" && x.1.starts_with("/connect/mcp")), "Composio Connect only, with the key: {c:?}");
+ }
+ }
+
+ // The same name again within minutes costs nothing.
+ call(&env.app, "GET", "/api/connections/composio/apps?q=ElevenLabs", None).await;
+ assert!(calls(&fake).iter().all(|c| c.1 != "/connect/mcp tools/call search"), "kept");
+
+ // Connect works for it like for any popular app.
+ let (s, v) = call(&env.app, "POST", "/api/connections/composio/apps/elevenlabs/connect", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["redirect_url"], "https://connect.composio.dev/link/lk_elevenlabs");
+
+ // A name Composio has no app for: no apps, Composio's unrelated toolkits left out, and the
+ // line to show instead.
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=notarealapp123", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["apps"], json!([]), "{v}");
+ assert_eq!(v["count"], 0);
+ assert_eq!(v["hint"], "kwant couldn't find an app called “notarealapp123” on Composio. Check the spelling or type the app's full name, or ask a bot to connect it.");
+ let c = calls(&fake);
+ assert_eq!(c.iter().filter(|x| x.1 == "/connect/mcp tools/call search").count(), 1, "{c:?}");
+ assert_eq!(c.iter().filter(|x| x.0 == "HEAD").count(), 1, "then its one app page: {c:?}");
+ assert!(c.iter().filter(|x| x.0 == "HEAD").all(|x| x.2.is_empty()), "no key to the app pages: {c:?}");
+
+ // A popular app: the popular rows exactly as before, and no search.
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=gmail", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["apps"][0]["slug"], "gmail");
+ assert!(v["apps"].as_array().unwrap().iter().all(|a| a.get("found_by_name").is_none()), "{v}");
+ assert!(calls(&fake).iter().all(|c| c.1 != "/connect/mcp tools/call search" && c.0 != "HEAD"));
+ // A popular app typed another way: its popular row, no call. (Round 1 used "Google Search
+ // Console" here, which isn't one of the 120 popular apps, so Composio was rightly asked.)
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=google-calendar", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert!(v["apps"].as_array().unwrap().iter().any(|a| a["slug"] == "googlecalendar"), "{v}");
+ assert!(calls(&fake).iter().all(|c| c.1 != "/connect/mcp tools/call search" && c.0 != "HEAD"));
+ // A popular app's name half typed: its popular rows, no call.
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=gma", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["apps"][0]["slug"], "gmail", "{v}");
+ assert!(v.get("hint").is_none(), "{v}");
+ assert!(calls(&fake).iter().all(|c| c.1 != "/connect/mcp tools/call search" && c.0 != "HEAD"));
+}
+
+/// Composio Connect can't answer: the public app page still finds the app, and a name nobody can
+/// answer about gets the top-apps line.
+#[tokio::test]
+async fn when_composio_connect_cannot_search_the_app_page_still_finds_it() {
+ let (env, fake) = env_with_fake().await;
+ let (s, v) = call(&env.app, "POST", "/api/connections/composio", Some(json!({"api_key": "ck_good"}))).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ // The saved key now fails at Composio Connect.
+ let space = kwnt::db::spaces::SpaceId::default_space();
+ let mut server = env.state.db.list_mcp_servers(&space).await.unwrap().remove(0);
+ server.headers.insert("x-consumer-api-key".into(), "ck_down".into());
+ env.state.db.update_mcp_server(&server).await.unwrap();
+ calls(&fake);
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=ElevenLabs", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ let app = v["apps"].as_array().unwrap().iter().find(|a| a["slug"] == "elevenlabs").cloned().unwrap_or_else(|| panic!("{v}"));
+ assert_eq!(app["name"], "ElevenLabs");
+ assert_eq!(app["connected"], false, "unknown without Composio Connect: {v}");
+ assert!(calls(&fake).iter().any(|c| c.0 == "HEAD" && c.1 == "/toolkits/elevenlabs"));
+}
+
+/// Before Composio is added: the public app page, with nothing but the app's name.
+#[tokio::test]
+async fn before_setup_an_app_beyond_the_popular_list_is_found_on_its_page() {
+ let (env, fake) = env_with_fake().await;
+ for typed in ["ElevenLabs", "elevenlabs", "Eleven%20Labs"] {
+ let (s, v) = call(&env.app, "GET", &format!("/api/connections/composio/apps?q={typed}"), None).await;
+ assert_eq!(s, StatusCode::OK, "{typed}: {v}");
+ assert_eq!((v["mode"].clone(), v["can_connect"].clone()), (Value::Null, json!(false)), "{v}");
+ let app = v["apps"].as_array().unwrap().iter().find(|a| a["slug"] == "elevenlabs").cloned().unwrap_or_else(|| panic!("{typed}: {v}"));
+ assert_eq!(app["name"], "ElevenLabs", "{typed}: {v}");
+ assert_eq!(app["logo"], "https://logos.composio.dev/api/elevenlabs");
+ assert!(v.get("hint").is_none());
+ }
+ let c = calls(&fake);
+ assert!(!c.is_empty() && c.iter().all(|x| x.0 == "HEAD" && x.1.starts_with("/toolkits/") && x.2.is_empty()), "only app pages, no key: {c:?}");
+ // ElevenLabs: its one page (elevenlabs reuses the answer); Eleven Labs: its 3 candidates.
+ assert_eq!(c.len(), 4, "at most 3 pages a name, each name once: {c:?}");
+
+ let (s, v) = call(&env.app, "GET", "/api/connections/composio/apps?q=notarealapp123", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["apps"], json!([]));
+ assert_eq!(v["hint"], "kwant couldn't find an app called “notarealapp123” on Composio. Check the spelling or type the app's full name, or ask a bot to connect it.");
+ // Pages out of reach: the line says what kwant could check.
+ let env2 = setup_with(|state| state.composio_api = Arc::new(ComposioApi::new("http://127.0.0.1:9"))).await;
+ let (s, v) = call(&env2.app, "GET", "/api/connections/composio/apps?q=Eleven%20Labs", None).await;
+ assert_eq!(s, StatusCode::OK, "{v}");
+ assert_eq!(v["apps"], json!([]), "{v}");
+ assert_eq!(v["hint"], "“Eleven Labs” isn't one of Composio's top apps, and kwant couldn't reach Composio to check the rest. Try again in a minute, or ask a bot to connect it.");
+}
diff --git a/tests/fixtures/composio/README.md b/tests/fixtures/composio/README.md
new file mode 100644
index 00000000..e186a8a1
--- /dev/null
+++ b/tests/fixtures/composio/README.md
@@ -0,0 +1,15 @@
+Recorded Composio answers (2026-11-13, Lin), trimmed: tool schemas cut to one, account ids and the
+person's details replaced with `[redacted]`/`*_redacted`. Recorded through a Composio Tool Router MCP
+server, which serves the same `COMPOSIO_SEARCH_TOOLS` and `COMPOSIO_MANAGE_CONNECTIONS` tools as
+Composio Connect.
+
+- `search_tools_*.json`: `COMPOSIO_SEARCH_TOOLS` with one `use_case` (the typed name). A real app's
+ slug appears in `results[].toolkits` and `toolkit_connection_statuses`; a made-up name still gets
+ unrelated toolkits back.
+- `manage_list_real_and_made_up.json`: `COMPOSIO_MANAGE_CONNECTIONS` `list` for elevenlabs (connected),
+ heygen (real, not connected) and notarealapp123 (made up). The real and the made-up one answer the
+ same ("initiated"), so `list` can't say whether an app exists.
+
+The composio.dev page check was recorded the same day with `curl -I`:
+elevenlabs 200, google_search_console 200, notarealapp123 404, googlesearchconsole 404,
+ElevenLabs 308 → /toolkits/elevenlabs.
diff --git a/tests/fixtures/composio/manage_list_real_and_made_up.json b/tests/fixtures/composio/manage_list_real_and_made_up.json
new file mode 100644
index 00000000..d8650f05
--- /dev/null
+++ b/tests/fixtures/composio/manage_list_real_and_made_up.json
@@ -0,0 +1,39 @@
+{
+ "successful": true,
+ "data": {
+ "message": "Processed 3 toolkits: 1 active, 2 initiated",
+ "results": {
+ "elevenlabs": {
+ "toolkit": "elevenlabs",
+ "status": "active",
+ "accounts": [
+ {
+ "id": "elevenlabs_redacted",
+ "alias": "Personal",
+ "status": "active",
+ "is_default": true,
+ "account_type": "PRIVATE"
+ }
+ ]
+ },
+ "heygen": {
+ "toolkit": "heygen",
+ "status": "initiated",
+ "accounts": []
+ },
+ "notarealapp123": {
+ "toolkit": "notarealapp123",
+ "status": "initiated",
+ "accounts": []
+ }
+ },
+ "summary": {
+ "total_toolkits": 3,
+ "active_connections": 1,
+ "initiated_connections": 2,
+ "failed_connections": 0
+ }
+ },
+ "error": null,
+ "log_id": "log_recorded"
+}
diff --git a/tests/fixtures/composio/search_tools_eleven_labs.json b/tests/fixtures/composio/search_tools_eleven_labs.json
new file mode 100644
index 00000000..59fa8908
--- /dev/null
+++ b/tests/fixtures/composio/search_tools_eleven_labs.json
@@ -0,0 +1,64 @@
+{
+ "successful": true,
+ "data": {
+ "results": [
+ {
+ "index": 1,
+ "use_case": "Eleven Labs",
+ "execution_guidance": "Found 7 tools for this query. Look at the schemas to know how to use them.",
+ "primary_tool_slugs": [
+ "ELEVENLABS_TEXT_TO_SPEECH",
+ "ELEVENLABS_GET_VOICES"
+ ],
+ "related_tool_slugs": [
+ "ELEVENLABS_TEXT_TO_SPEECH_STREAM",
+ "ELEVENLABS_GET_MODELS",
+ "ELEVENLABS_SYNTHESIZE_TIMESTAMPED_SPEECH",
+ "ELEVENLABS_SEARCH_VOICES",
+ "ELEVENLABS_GET_VOICE"
+ ],
+ "toolkits": [
+ "elevenlabs"
+ ]
+ }
+ ],
+ "toolkit_connection_statuses": [
+ {
+ "toolkit": "elevenlabs",
+ "description": "Create natural AI voices instantly in any language - perfect for video creators, developers, and businesses.",
+ "has_active_connection": true,
+ "accounts": [
+ {
+ "id": "elevenlabs_redacted",
+ "alias": "Personal",
+ "status": "ACTIVE",
+ "created_at": "2026-10-10T22:23:17.641Z",
+ "is_default": true,
+ "account_type": "PRIVATE"
+ }
+ ],
+ "status_message": "Connection is active and ready to use"
+ }
+ ],
+ "tool_schemas": {
+ "ELEVENLABS_GET_VOICES": {
+ "toolkit": "ELEVENLABS",
+ "tool_slug": "ELEVENLABS_GET_VOICES",
+ "description": "Retrieves a list of all available voices along with their detailed attributes and settings.",
+ "input_schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "hasFullSchema": true
+ }
+ },
+ "session": {
+ "id": "size",
+ "generate_id": true
+ },
+ "success": true,
+ "error": null
+ },
+ "error": null,
+ "log_id": "log_recorded"
+}
diff --git a/tests/fixtures/composio/search_tools_elevenlabs.json b/tests/fixtures/composio/search_tools_elevenlabs.json
new file mode 100644
index 00000000..e797bafa
--- /dev/null
+++ b/tests/fixtures/composio/search_tools_elevenlabs.json
@@ -0,0 +1,61 @@
+{
+ "successful": true,
+ "data": {
+ "results": [
+ {
+ "index": 1,
+ "use_case": "elevenlabs",
+ "execution_guidance": "Found 4 tools for this query. Look at the schemas to know how to use them.",
+ "primary_tool_slugs": [
+ "ELEVENLABS_TEXT_TO_SPEECH"
+ ],
+ "related_tool_slugs": [
+ "ELEVENLABS_TEXT_TO_SPEECH_STREAM",
+ "ELEVENLABS_GET_VOICES",
+ "ELEVENLABS_GET_MODELS"
+ ],
+ "toolkits": [
+ "elevenlabs"
+ ]
+ }
+ ],
+ "toolkit_connection_statuses": [
+ {
+ "toolkit": "elevenlabs",
+ "description": "Create natural AI voices instantly in any language - perfect for video creators, developers, and businesses.",
+ "has_active_connection": true,
+ "accounts": [
+ {
+ "id": "elevenlabs_redacted",
+ "alias": "Personal",
+ "status": "ACTIVE",
+ "created_at": "2026-10-10T22:23:17.641Z",
+ "is_default": true,
+ "account_type": "PRIVATE"
+ }
+ ],
+ "status_message": "Connection is active and ready to use"
+ }
+ ],
+ "tool_schemas": {
+ "ELEVENLABS_GET_VOICES": {
+ "toolkit": "ELEVENLABS",
+ "tool_slug": "ELEVENLABS_GET_VOICES",
+ "description": "Retrieves a list of all available voices along with their detailed attributes and settings.",
+ "input_schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "hasFullSchema": true
+ }
+ },
+ "session": {
+ "id": "size",
+ "generate_id": true
+ },
+ "success": true,
+ "error": null
+ },
+ "error": null,
+ "log_id": "log_recorded"
+}
diff --git a/tests/fixtures/composio/search_tools_notarealapp123.json b/tests/fixtures/composio/search_tools_notarealapp123.json
new file mode 100644
index 00000000..323d5978
--- /dev/null
+++ b/tests/fixtures/composio/search_tools_notarealapp123.json
@@ -0,0 +1,71 @@
+{
+ "successful": true,
+ "data": {
+ "results": [
+ {
+ "index": 1,
+ "use_case": "notarealapp123",
+ "execution_guidance": "Found 4 tools for this query. Look at the schemas to know how to use them.",
+ "primary_tool_slugs": [
+ "GOOGLESUPER_GET_APP",
+ "INSPO_MCP_FIND_COMPONENTS"
+ ],
+ "related_tool_slugs": [
+ "INSPO_MCP_GET_FILTERS",
+ "INSPO_MCP_FIND_REFERENCE_COMPONENTS"
+ ],
+ "toolkits": [
+ "googlesuper",
+ "inspo_mcp"
+ ]
+ }
+ ],
+ "toolkit_connection_statuses": [
+ {
+ "toolkit": "googlesuper",
+ "description": "Google Super App combines all Google services including Drive, Calendar, Gmail, Sheets, Analytics, Ads, and more, providing a unified platform for seamless integration and management of your digital life.",
+ "has_active_connection": true,
+ "accounts": [
+ {
+ "id": "googlesuper_redacted",
+ "alias": "Personal",
+ "user_info": {
+ "name": "[redacted]",
+ "email": "[redacted]"
+ },
+ "status": "ACTIVE",
+ "is_default": true,
+ "account_type": "PRIVATE"
+ }
+ ],
+ "status_message": "Connection is active and ready to use"
+ },
+ {
+ "toolkit": "inspo_mcp",
+ "description": "Inspo MCP provides read-only design-reference search across captured production websites, components, color palettes, typography, and page structure for coding agents.",
+ "has_active_connection": true,
+ "status_message": "This toolkit does not require authentication. Tools are ready to use."
+ }
+ ],
+ "tool_schemas": {
+ "ELEVENLABS_GET_VOICES": {
+ "toolkit": "ELEVENLABS",
+ "tool_slug": "ELEVENLABS_GET_VOICES",
+ "description": "Retrieves a list of all available voices along with their detailed attributes and settings.",
+ "input_schema": {
+ "type": "object",
+ "properties": {}
+ },
+ "hasFullSchema": true
+ }
+ },
+ "session": {
+ "id": "size",
+ "generate_id": true
+ },
+ "success": true,
+ "error": null
+ },
+ "error": null,
+ "log_id": "log_recorded"
+}