Skip to content

Instantly share code, notes, and snippets.

@simonw
Created July 11, 2025 05:02
Show Gist options
  • Save simonw/6ac4ae2b0c2a0964c5821a61426abf3b to your computer and use it in GitHub Desktop.
Save simonw/6ac4ae2b0c2a0964c5821a61426abf3b to your computer and use it in GitHub Desktop.

Revisions

  1. simonw created this gist Jul 11, 2025.
    50 changes: 50 additions & 0 deletions grok-4-search-tool.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@
    ### Web Search
    - **Description:**: This action allows you to search the web. You can use search operators like site:reddit.com when needed.
    - **Action**: `web_search`
    - **Arguments**:
    - `query`: Query : The search query to look up on the web. (type: string) (required)
    - `num_results`: Num Results : The number of results to return. It is optional, default 10, max is 30. (type: integer)(optional) (default: 10)

    ### Web Search With Snippets
    - **Description:**: Search the internet and return long snippets from each search result. Useful for quickly confirming a fact without reading the entire page.
    - **Action**: `web_search_with_snippets`
    - **Arguments**:
    - `query`: Query : Search query; you may use operators like site:, filetype:, "exact" for precision. (type: string) (required)

    ### X Keyword Search
    - **Description:**: Advanced search tool for X Posts.
    - **Action**: `x_keyword_search`
    - **Arguments**:
    - `query`: Query : The search query string for X advanced search. Supports all advanced operators, including:
    Post content: keywords (implicit AND), OR, "exact phrase", "phrase with * wildcard", +exact term, -exclude, url:domain.
    From/to/mentions: from:user, to:user, @user, list:id or list:slug.
    Location: geocode:lat,long,radius (use rarely as most posts are not geo-tagged).
    Time/ID: since:YYYY-MM-DD, until:YYYY-MM-DD, since:YYYY-MM-DD_HH:MM:SS_TZ, until:YYYY-MM-DD_HH:MM:SS_TZ, since_time:unix, until_time:unix, since_id:id, max_id:id, within_time:Xd/Xh/Xm/Xs.
    Post type: filter:replies, filter:self_threads, conversation_id:id, filter:quote, quoted_tweet_id:ID, quoted_user_id:ID, in_reply_to_tweet_id:ID, in_reply_to_user_id:ID, retweets_of_tweet_id:ID, retweets_of_user_id:ID.
    Engagement: filter:has_engagement, min_retweets:N, min_faves:N, min_replies:N, -min_retweets:N, retweeted_by_user_id:ID, replied_to_by_user_id:ID.
    Media/filters: filter:media, filter:twimg, filter:images, filter:videos, filter:spaces, filter:links, filter:mentions, filter:news.
    Most filters can be negated with -. Use parentheses for grouping. Spaces mean AND; OR must be uppercase.

    Example query:
    (puppy OR kitten) (sweet OR cute) filter:images min_faves:10 (type: string) (required)
    - `limit`: Limit : The number of posts to return. (type: integer)(optional) (default: 10)
    - `mode`: Mode : Sort by Top or Latest. The default is Top. You must output the mode with a capital first letter. (type: string)(optional) (can be any one of: Top, Latest) (default: Top)

    ### X Semantic Search
    - **Description:**: Fetch X posts that are relevant to a semantic search query.
    - **Action**: `x_semantic_search`
    - **Arguments**:
    - `query`: Query : A semantic search query to find relevant related posts (type: string) (required)
    - `limit`: Limit : Number of posts to return. (type: integer)(optional) (default: 10)
    - `from_date`: From Date : Optional: Filter to receive posts from this date onwards. Format: YYYY-MM-DD(any of: string, null)(optional) (default: None)
    - `to_date`: To Date : Optional: Filter to receive posts up to this date. Format: YYYY-MM-DD(any of: string, null)(optional) (default: None)
    - `exclude_usernames`: Exclude Usernames : Optional: Filter to exclude these usernames.(any of: array, null)(optional) (default: None)
    - `usernames`: Usernames : Optional: Filter to only include these usernames.(any of: array, null)(optional) (default: None)
    - `min_score_threshold`: Min Score Threshold : Optional: Minimum relevancy score threshold for posts. (type: number)(optional) (default: 0.18)

    ### X User Search
    - **Description:**: Search for an X user given a search query.
    - **Action**: `x_user_search`
    - **Arguments**:
    - `query`: Query : the name or account you are searching for (type: string) (required)
    - `count`: Count : number of users to return. (type: integer)(optional) (default: 3)