Riferimento API
Azioni
Un'azione è uno strumento del server MCP, via REST. Ognuna ha il nome, l'input e il risultato del suo strumento MCP, quindi uno script esegue ciò che eseguirebbe un assistente IA, con una chiave API e senza client MCP.
La maggior parte è anche un endpoint a sé nelle altre pagine. Usa un'azione per uno strumento che non ha un endpoint, o per chiamare tutti gli strumenti allo stesso modo.
L'oggetto azione
Uno strumento del server MCP, come lo vede la tua chiave.
Attributi
- objectstringSempre
action. - namestringIl suo nome, lo stesso dello strumento MCP, come
search_leads. - titlestringIl suo titolo in poche parole.
- descriptionstringCosa fa e cosa restituisce, le parole che legge un assistente IA.
- scopestring
writequando modifica i dati. Una chiave conreadesegue solo le altre.readwrite - input_schemaobjectIl JSON Schema del body che accetta, i suoi campi e quelli obbligatori.
{
"object": "action",
"name": "get_lead",
"title": "Get lead",
"description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
"scope": "read",
"input_schema": {
"type": "object",
"properties": {
"lead_id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "From search_leads."
}
},
"required": ["lead_id"],
"additionalProperties": false
}
}Elenca le azioni
readRestituisce tutte le azioni che la tua chiave può eseguire, per nome.
Restituisce
Un elenco di oggetti azione, tutte in una sola pagina.
curl https://gemlead.ai/api/v1/actions \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "list",
"data": [
{
"object": "action",
"name": "get_lead",
"title": "Get lead",
"description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
"scope": "read",
"input_schema": {
"type": "object",
"properties": {
"lead_id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "From search_leads."
}
},
"required": ["lead_id"],
"additionalProperties": false
}
}
],
"has_more": false
}Recupera un'azione
readRestituisce un'azione, con lo schema del body che accetta.
Parametri di percorso
- namestringObbligatorioIl nome dell'azione, come
search_leads.
Restituisce
Un oggetto azione.
Errori
- Nessuna azione con questo nome per la tua chiave. Elenca le azioni dà i loro nomi.
curl https://gemlead.ai/api/v1/actions/get_lead \
-H "Authorization: Bearer $GEMLEAD_API_KEY"{
"object": "action",
"name": "get_lead",
"title": "Get lead",
"description": "One lead by id: X profile, score and reason, hot, status, persona, campaign, conversation id, locked_to (the one X account of the owner allowed to contact this person, when a campaign or a conversation holds it), your metadata.",
"scope": "read",
"input_schema": {
"type": "object",
"properties": {
"lead_id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "From search_leads."
}
},
"required": ["lead_id"],
"additionalProperties": false
}
}Esegui un'azione
readEsegue un'azione come il server MCP esegue il suo strumento. Il body è il suo input, i campi che elenca il suo input_schema, oppure vuoto per un'azione che non accetta nulla. Un'azione con scope write richiede una chiave con write.
Parametri di percorso
- namestringObbligatorioIl nome dell'azione, come
search_leads.
Restituisce
Un oggetto risultato dell'azione. Gli errori propri dell'azione arrivano così come sono, come resource_missing per un lead che non è sull'account.
Errori
- Nessuna azione con questo nome per la tua chiave. Elenca le azioni dà i loro nomi.
- Lo scope dell'azione è
writee la chiave haread. - Manca un campo che l'azione richiede.
paramlo indica. - Il body non corrisponde all'
input_schemadell'azione. - L'azione non è riuscita da parte nostra. Non c'è nulla da cambiare nella richiesta, riprova tra un momento.
curl -X POST https://gemlead.ai/api/v1/actions/get_lead \
-H "Authorization: Bearer $GEMLEAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lead_id": "msgOtJ8dvT"
}'{
"object": "action_result",
"action": "get_lead",
"result": {
"id": "msgOtJ8dvT",
"object": "lead",
"profile": {
"x_user_id": "1460283925",
"username": "jane_builds",
"name": "Jane Doe",
"bio": "Runs a paid trading community. Daily setups, no hype.",
"followers_count": 12400,
"following_count": 380,
"location": "Austin, TX",
"website": "https://janedoe.com",
"profile_image_url": "https://pbs.twimg.com/profile_images/1460283925/jane_400x400.jpg",
"verified": true,
"url": "https://x.com/jane_builds"
},
"score": 86,
"score_reason": "Runs a paid trading community and asks how to collect payments for it.",
"hot": true,
"status": "scored",
"persona": {
"id": "lvWBPnytpS",
"name": "Tipsters"
},
"campaign": null,
"conversation_id": null,
"locked_to": null,
"found_at": "2026-11-05T14:02:11.482Z",
"scored_at": "2026-11-05T14:03:40.117Z",
"updated_at": "2026-11-05T14:03:40.117Z",
"metadata": {},
"contact": null
}
}L'oggetto risultato dell'azione
Ciò che un'azione ha restituito quando l'hai eseguita.
Attributi
- objectstringSempre
action_result. - actionstringIl nome dell'azione.
- resultanyIl suo risultato, lo stesso dello strumento MCP, come un oggetto lead per
get_lead.nullquando non restituisce nulla.
{
"object": "action_result",
"action": "get_lead",
"result": {
"id": "msgOtJ8dvT",
"object": "lead",
"profile": {
"x_user_id": "1460283925",
"username": "jane_builds",
"name": "Jane Doe",
"bio": "Runs a paid trading community. Daily setups, no hype.",
"followers_count": 12400,
"following_count": 380,
"location": "Austin, TX",
"website": "https://janedoe.com",
"profile_image_url": "https://pbs.twimg.com/profile_images/1460283925/jane_400x400.jpg",
"verified": true,
"url": "https://x.com/jane_builds"
},
"score": 86,
"score_reason": "Runs a paid trading community and asks how to collect payments for it.",
"hot": true,
"status": "scored",
"persona": {
"id": "lvWBPnytpS",
"name": "Tipsters"
},
"campaign": null,
"conversation_id": null,
"locked_to": null,
"found_at": "2026-11-05T14:02:11.482Z",
"scored_at": "2026-11-05T14:03:40.117Z",
"updated_at": "2026-11-05T14:03:40.117Z",
"metadata": {},
"contact": null
}
}