Skip to main content
Search recent public posts on X (Twitter) in agent workflows with a single function call.
The user describes a topic; the agent searches recent public X posts via Xquik and summarises highlights.

Quick Start

1

Set your API key

2

Install and run


How It Works

Each result line uses the format @author: text (tweet_id) so agents can reference specific posts downstream.

Configuration

Prerequisites

Function Signature

availability= decorator pattern

The @tool(availability=_xquik_api_key_available) decorator hides search_x_posts from the agent’s tool list when XQUIK_API_KEY is not set. This pattern works for any API-key-gated tool:
When the env var is absent the tool is silently omitted — no runtime error, no confusing model hallucination.

Common Patterns

Multiple queries in one agent run

Combine with a summariser


Best Practices

The tool returns a clear error message if the key is missing, but the agent cannot search. Export the key in your shell or .env before running.
The limit parameter is clamped server-side to [1, 10]. Passing 0 returns 1 result; passing 50 returns 10. Be explicit in your agent instructions.
Vague queries like “AI” return broad results. Use specific phrases like “AI agent frameworks 2025” or include relevant hashtags.
When no posts match, the tool returns "No results found for '...'". Instruct agents to try alternative queries in that case.

Tavily Search

Web search with AI-optimised results

Exa Search

Neural search for the web

Tool Availability

Gate tools on env vars with the availability= decorator

Custom Tools

Build your own tool functions