Skip to content

feat(tools): add Xquik X research tools#5784

Open
kriptoburak wants to merge 1 commit into
crewAIInc:mainfrom
kriptoburak:codex/add-xquik-crewai-tools
Open

feat(tools): add Xquik X research tools#5784
kriptoburak wants to merge 1 commit into
crewAIInc:mainfrom
kriptoburak:codex/add-xquik-crewai-tools

Conversation

@kriptoburak

@kriptoburak kriptoburak commented May 12, 2026

Copy link
Copy Markdown

Summary

  • Add 5 Xquik REST API tools for public X/Twitter research workflows.
  • Export the tools from crewai_tools and crewai_tools.tools.
  • Add mocked behavioral tests and localized documentation.
  • Fix an existing duplicate word in the CrewAI Tools MCP guide.

Review Repairs

  • Preserve all resolved CodeRabbit fixes for path encoding, WOEID validation, tests, and exports.
  • Rebase the branch on current upstream main as one signed commit.
  • Route requests through CrewAI's SSRF-safe request helper.
  • Strip API credentials from cross-origin redirects.
  • Bound both text and structured API error details to 500 characters.
  • Keep function docstrings and exact public attribution across every Xquik tool page.

Validation

  • uv run ruff check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py
  • uv run ruff format --check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py
  • uv run mypy lib/crewai-tools/src/crewai_tools/tools/xquik_tool
  • uv run pytest lib/crewai-tools/tests/tools/xquik_tool_test.py -q - 12 passed
  • Targeted pre-commit hooks for all changed files
  • Docs JSON parse and git diff --check

This contribution was prepared with AI assistance. External contributors cannot apply repository labels, so a maintainer must add the required llm-generated label.

Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c06568be-e0b1-412e-a3d9-73706a8a4194

📥 Commits

Reviewing files that changed from the base of the PR and between 32ea29d and 9bef066.

📒 Files selected for processing (16)
  • docs/docs.json
  • docs/edge/ar/tools/search-research/overview.mdx
  • docs/edge/ar/tools/search-research/xquiktool.mdx
  • docs/edge/en/tools/search-research/overview.mdx
  • docs/edge/en/tools/search-research/xquiktool.mdx
  • docs/edge/ko/tools/search-research/overview.mdx
  • docs/edge/ko/tools/search-research/xquiktool.mdx
  • docs/edge/pt-BR/tools/search-research/overview.mdx
  • docs/edge/pt-BR/tools/search-research/xquiktool.mdx
  • lib/crewai-tools/README.md
  • lib/crewai-tools/src/crewai_tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/README.md
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py
  • lib/crewai-tools/tests/tools/xquik_tool_test.py
🚧 Files skipped from review as they are similar to previous changes (7)
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/init.py
  • docs/docs.json
  • lib/crewai-tools/src/crewai_tools/tools/init.py
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/README.md
  • lib/crewai-tools/src/crewai_tools/init.py
  • lib/crewai-tools/tests/tools/xquik_tool_test.py
  • lib/crewai-tools/README.md

📝 Walkthrough

Walkthrough

Adds five Xquik tools for X/Twitter data retrieval, authenticated REST requests, validation and error handling, package exports, tests, README updates, and localized documentation with navigation entries.

Changes

Xquik X/Twitter Tool Feature

Layer / File(s) Summary
Core implementation and schemas
lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py
Adds authenticated Xquik REST requests, input schemas, normalization and validation helpers, error handling, and tools for tweet search, tweet lookup, user lookup, user tweets, and trends.
Package exports and wiring
lib/crewai-tools/src/crewai_tools/tools/xquik_tool/__init__.py, lib/crewai-tools/src/crewai_tools/tools/__init__.py, lib/crewai-tools/src/crewai_tools/__init__.py
Exports all five Xquik tool classes from the feature, tools, and root packages.
Tests and validation
lib/crewai-tools/tests/tools/xquik_tool_test.py
Tests authentication, request headers and parameters, URL encoding, optional flags, validation failures, HTTP errors, and request exceptions.
README and localized documentation
lib/crewai-tools/README.md, lib/crewai-tools/src/crewai_tools/tools/xquik_tool/README.md, docs/edge/*/tools/search-research/*, docs/docs.json
Documents setup and usage, adds localized Xquik pages and overview cards, and registers the pages in locale tool lists.

Sequence Diagram(s)

sequenceDiagram
  participant Agent as CrewAI Agent
  participant XquikTool as Xquik Tool
  participant API as Xquik REST API
  Agent->>XquikTool: run with search, tweet, user, or trends arguments
  XquikTool->>API: GET endpoint with API key and query parameters
  API-->>XquikTool: JSON result or error response
  XquikTool-->>Agent: tool result or RuntimeError
Loading

Suggested reviewers: vinibrsl

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding Xquik X/Twitter research tools.
Description check ✅ Passed The description matches the changeset by covering the new tools, exports, tests, docs, and related fixes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
lib/crewai-tools/README.md (1)

29-29: ⚡ Quick win

Expand the API integrations list to include all new Xquik tools.

Only XquikSearchTweetsTool is listed, while this PR ships five Xquik tools. Updating this line improves discoverability.

💡 Suggested update
-- **API Integrations**: `SerperApiTool`, `ExaSearchTool`, `XquikSearchTweetsTool`
+- **API Integrations**: `SerperApiTool`, `ExaSearchTool`, `XquikSearchTweetsTool`, `XquikGetTweetTool`, `XquikGetUserTool`, `XquikGetUserTweetsTool`, `XquikGetTrendsTool`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-tools/README.md` at line 29, Update the README line that lists API
integrations to include all five Xquik tool class names (not just
XquikSearchTweetsTool); locate the entry in lib/crewai-tools/README.md where
"API Integrations" mentions `XquikSearchTweetsTool` and add the other four Xquik
tool symbols (use the exact exported class names as defined in the diff) so the
line enumerates all Xquik tools alongside `SerperApiTool` and `ExaSearchTool`,
preserving the same inline code formatting and comma-separated style.
lib/crewai-tools/tests/tools/xquik_tool_test.py (1)

87-95: ⚡ Quick win

Strengthen encoding assertions with non-safe identifiers.

Line 87 and Line 98 claim path encoding behavior, but current inputs ("123", "crew_ai") don’t require encoding. Add at least one case with reserved characters (e.g., spaces, /, ?, %) to verify actual percent-encoding and avoid false confidence in these tests.

Also applies to: 98-106

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/crewai-tools/tests/tools/xquik_tool_test.py` around lines 87 - 95, The
test test_get_tweet_encodes_tweet_id currently uses safe identifiers ("123") so
it doesn't verify URL percent-encoding; update this test (and the analogous one
around lines 98-106 that checks user id encoding) to include at least one case
with reserved characters (e.g., a tweet_id/user_id containing space, "/", "?",
"%") and assert the HTTP GET URL built by XquikGetTweetTool.run (and the user-id
test's tool) contains the percent-encoded form (and not the raw reserved
characters); locate the code that inspects mock_get.call_args.args[0] and add
assertions for the encoded substring (and/or absence of the raw substring) to
prove real percent-encoding is applied.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py`:
- Around line 183-186: The woeid Field is unbounded and can be 0/negative; add
input validation so callers get a clear error before the API call. Update the
woeid Field declaration(s) (the woeid in the model around the shown block and
the similar Field at the later block) to require a minimum of 1 (e.g.,
Field(..., ge=1, description=...)) or add a pydantic `@validator`("woeid") that
raises ValueError if value < 1, and include a clear message like "woeid must be
>= 1 (use 1 for worldwide)". Ensure both occurrences use the same validation
approach.
- Around line 30-35: The function _normalize_path_identifier currently allows
values like "@" because cleaned.lstrip("@") can become empty; update the
validation to reject identifiers that become empty after stripping leading "@"
by computing stripped = cleaned.lstrip("@") and raising ValueError(f"{name} is
required") if not stripped before calling quote, so the function returns
quote(stripped, safe="") only for non-empty identifiers.

---

Nitpick comments:
In `@lib/crewai-tools/README.md`:
- Line 29: Update the README line that lists API integrations to include all
five Xquik tool class names (not just XquikSearchTweetsTool); locate the entry
in lib/crewai-tools/README.md where "API Integrations" mentions
`XquikSearchTweetsTool` and add the other four Xquik tool symbols (use the exact
exported class names as defined in the diff) so the line enumerates all Xquik
tools alongside `SerperApiTool` and `ExaSearchTool`, preserving the same inline
code formatting and comma-separated style.

In `@lib/crewai-tools/tests/tools/xquik_tool_test.py`:
- Around line 87-95: The test test_get_tweet_encodes_tweet_id currently uses
safe identifiers ("123") so it doesn't verify URL percent-encoding; update this
test (and the analogous one around lines 98-106 that checks user id encoding) to
include at least one case with reserved characters (e.g., a tweet_id/user_id
containing space, "/", "?", "%") and assert the HTTP GET URL built by
XquikGetTweetTool.run (and the user-id test's tool) contains the percent-encoded
form (and not the raw reserved characters); locate the code that inspects
mock_get.call_args.args[0] and add assertions for the encoded substring (and/or
absence of the raw substring) to prove real percent-encoding is applied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b7366df4-4d6d-45b9-9aa7-36644bf15b67

📥 Commits

Reviewing files that changed from the base of the PR and between 264da82 and 206a348.

📒 Files selected for processing (16)
  • docs/ar/tools/search-research/overview.mdx
  • docs/ar/tools/search-research/xquiktool.mdx
  • docs/docs.json
  • docs/en/tools/search-research/overview.mdx
  • docs/en/tools/search-research/xquiktool.mdx
  • docs/ko/tools/search-research/overview.mdx
  • docs/ko/tools/search-research/xquiktool.mdx
  • docs/pt-BR/tools/search-research/overview.mdx
  • docs/pt-BR/tools/search-research/xquiktool.mdx
  • lib/crewai-tools/README.md
  • lib/crewai-tools/src/crewai_tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/README.md
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/__init__.py
  • lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py
  • lib/crewai-tools/tests/tools/xquik_tool_test.py

Comment thread lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py
Comment thread lib/crewai-tools/src/crewai_tools/tools/xquik_tool/xquik_tool.py
@kriptoburak
kriptoburak force-pushed the codex/add-xquik-crewai-tools branch from 0f5c31d to fdda792 Compare May 14, 2026 21:32
@kriptoburak

Copy link
Copy Markdown
Author

Maintenance update after the branch fell behind main.

I rebased the PR on current crewAIInc/crewAI main and force-pushed head fdda792f945ccf1cf2362224f965cca8eb141c32. GitHub still shows the same 16 changed files, CodeRabbit is green, and the review remains approved.

Focused local validation passed: Ruff format check, Ruff lint, Xquik tool pytest (11 passed), docs JSON parse, and Git diff whitespace check.

@kriptoburak
kriptoburak force-pushed the codex/add-xquik-crewai-tools branch 11 times, most recently from 6e5ee0e to 4bdb60a Compare May 21, 2026 23:32
@kriptoburak

Copy link
Copy Markdown
Author

Maintenance update after the branch fell behind main.

I rebased this PR on current crewAIInc/crewAI main and force-pushed head 4bdb60ad0dfe6798f5c117597d678637c3283e71. GitHub still shows the same 16 changed files, CodeRabbit is green, GitGuardian is green, and the review remains approved.

Focused local validation passed: uv run ruff check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py, uv run ruff format --check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py, uv run pytest tests/tools/xquik_tool_test.py -q, docs JSON parse, git diff --check origin/main...HEAD, and a public-safety scan.

@kriptoburak
kriptoburak force-pushed the codex/add-xquik-crewai-tools branch 2 times, most recently from 0bccde5 to e82ea3e Compare May 22, 2026 19:54
@kriptoburak
kriptoburak force-pushed the codex/add-xquik-crewai-tools branch from e82ea3e to 5eac782 Compare June 6, 2026 07:32
@kriptoburak

Copy link
Copy Markdown
Author

Maintenance update after upstream moved the docs tree.

I merged current upstream main, resolved the docs conflicts by moving the Xquik docs to the current docs/edge/* paths, and force-free pushed head 9ac9d3de5a984d882e52ef5090552a61a253bc1d.

Focused validation passed:

  • git diff --check
  • docs JSON parse and Xquik docs navigation check
  • uv run ruff check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py
  • uv run ruff format --check lib/crewai-tools/src/crewai_tools/tools/xquik_tool lib/crewai-tools/tests/tools/xquik_tool_test.py
  • uv run pytest lib/crewai-tools/tests/tools/xquik_tool_test.py -q (11 passed)

@kriptoburak

kriptoburak commented Jul 18, 2026

Copy link
Copy Markdown
Author

Maintenance update after the full review audit.

I rebased this PR on current crewAIInc/crewAI main and consolidated the branch into one SSH-signed commit, 9bef0667fb74854085fea2b8fb077dd602d305e9. All CodeRabbit requests remain addressed, both review threads are resolved, and the existing duplicate-word defect in the CrewAI Tools MCP guide is fixed alongside the Xquik integration.

Focused validation passed: Ruff lint, Ruff format, strict mypy for the Xquik package, 12 targeted tests, targeted pre-commit hooks for all changed files, docs JSON parsing, and Git whitespace checks.

This contribution used AI assistance. I cannot apply repository labels as an external contributor, so a maintainer must add the required llm-generated label.

The fresh CodeRabbit review finished successfully with no new actionable findings.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kriptoburak
kriptoburak force-pushed the codex/add-xquik-crewai-tools branch from 32ea29d to 9bef066 Compare July 19, 2026 17:25
@kriptoburak kriptoburak changed the title Add Xquik X/Twitter research tools feat(tools): add Xquik X research tools Jul 19, 2026
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

@kriptoburak: Review requested for #5784. A maintainer will need to apply the required llm-generated label.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant