Files
sim/apps/docs/content/docs/en/tools/reddit.mdx
Waleed f99518b837 feat(calcom): added calcom (#3070)
* feat(tools): added calcom

* added more triggers, tested

* updated regex in script for release to be more lenient

* fix(tag-dropdown): performance improvements and scroll bug fixes

- Add flatTagIndexMap for O(1) tag lookups (replaces O(n²) findIndex calls)
- Memoize caret position calculation to avoid DOM manipulation on every render
- Use refs for inputValue/cursorPosition to keep handleTagSelect callback stable
- Change itemRefs from index-based to tag-based keys to prevent stale refs
- Fix scroll jump in nested folders by removing scroll reset from registerFolder
- Add onFolderEnter callback for scroll reset when entering folder via keyboard
- Disable keyboard navigation wrap-around at boundaries
- Simplify selection reset to single effect on flatTagList.length change

Also:
- Add safeCompare utility for timing-safe string comparison
- Refactor webhook signature validation to use safeCompare

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* updated types

* fix(calcom): simplify required field constraints for booking attendee

The condition field already restricts these to calcom_create_booking,
so simplified to required: true. Per Cal.com API docs, email is optional
while name and timeZone are required.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* added tests

* updated folder multi select, updated calcom and github tools and docs generator script

* updated drag, updated outputs for tools, regen docs with nested docs script

* updated setup instructions links, destructure trigger outputs, fix text subblock styling

* updated docs gen script

* updated docs script

* updated docs script

* updated script

* remove destructuring of stripe webhook

* expanded wand textarea, updated calcom tools

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 20:37:30 -08:00

349 lines
14 KiB
Plaintext

---
title: Reddit
description: Access Reddit data and content
---
import { BlockInfoCard } from "@/components/ui/block-info-card"
<BlockInfoCard
type="reddit"
color="#FF5700"
/>
{/* MANUAL-CONTENT-START:intro */}
[Reddit](https://www.reddit.com/) is a social platform where users share and discuss content in topic-based communities called subreddits.
In Sim, you can use the Reddit integration to:
- **Get Posts**: Retrieve posts from any subreddit, with options to sort (Hot, New, Top, Rising) and filter Top posts by time (Day, Week, Month, Year, All Time).
- **Get Comments**: Fetch comments from a specific post, with options to sort and set the number of comments.
These operations let your agents access and analyze Reddit content as part of your automated workflows.
{/* MANUAL-CONTENT-END */}
## Usage Instructions
Integrate Reddit into workflows. Read posts, comments, and search content. Submit posts, vote, reply, edit, and manage your Reddit account.
## Tools
### `reddit_get_posts`
Fetch posts from a subreddit with different sorting options
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The name of the subreddit to fetch posts from \(without the r/ prefix\) |
| `sort` | string | No | Sort method for posts: "hot", "new", "top", or "rising" \(default: "hot"\) |
| `limit` | number | No | Maximum number of posts to return \(default: 10, max: 100\) |
| `time` | string | No | Time filter for "top" sorted posts: "day", "week", "month", "year", or "all" \(default: "day"\) |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
| `sr_detail` | boolean | No | Expand subreddit details in the response |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where posts were fetched from |
| `posts` | array | Array of posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_get_comments`
Fetch comments from a specific Reddit post
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `postId` | string | Yes | The ID of the Reddit post to fetch comments from |
| `subreddit` | string | Yes | The subreddit where the post is located \(without the r/ prefix\) |
| `sort` | string | No | Sort method for comments: "confidence", "top", "new", "controversial", "old", "random", "qa" \(default: "confidence"\) |
| `limit` | number | No | Maximum number of comments to return \(default: 50, max: 100\) |
| `depth` | number | No | Maximum depth of subtrees in the thread \(controls nested comment levels\) |
| `context` | number | No | Number of parent comments to include |
| `showedits` | boolean | No | Show edit information for comments |
| `showmore` | boolean | No | Include "load more comments" elements in the response |
| `showtitle` | boolean | No | Include submission title in the response |
| `threaded` | boolean | No | Return comments in threaded/nested format |
| `truncate` | number | No | Integer to truncate comment depth |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `post` | object | Post information including ID, title, author, content, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Post author |
| ↳ `selftext` | string | Post text content |
| ↳ `score` | number | Post score |
| ↳ `created_utc` | number | Creation timestamp |
| ↳ `permalink` | string | Reddit permalink |
| `comments` | array | Nested comments with author, body, score, timestamps, and replies |
| ↳ `id` | string | Comment ID |
| ↳ `author` | string | Comment author |
| ↳ `body` | string | Comment text |
| ↳ `score` | number | Comment score |
| ↳ `created_utc` | number | Creation timestamp |
| ↳ `permalink` | string | Comment permalink |
| ↳ `replies` | array | Nested reply comments |
### `reddit_get_controversial`
Fetch controversial posts from a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The name of the subreddit to fetch posts from \(without the r/ prefix\) |
| `time` | string | No | Time filter for controversial posts: "hour", "day", "week", "month", "year", or "all" \(default: "all"\) |
| `limit` | number | No | Maximum number of posts to return \(default: 10, max: 100\) |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
| `sr_detail` | boolean | No | Expand subreddit details in the response |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where posts were fetched from |
| `posts` | array | Array of controversial posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_search`
Search for posts within a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The name of the subreddit to search in \(without the r/ prefix\) |
| `query` | string | Yes | Search query text |
| `sort` | string | No | Sort method for search results: "relevance", "hot", "top", "new", or "comments" \(default: "relevance"\) |
| `time` | string | No | Time filter for search results: "hour", "day", "week", "month", "year", or "all" \(default: "all"\) |
| `limit` | number | No | Maximum number of posts to return \(default: 10, max: 100\) |
| `restrict_sr` | boolean | No | Restrict search to the specified subreddit only \(default: true\) |
| `after` | string | No | Fullname of a thing to fetch items after \(for pagination\) |
| `before` | string | No | Fullname of a thing to fetch items before \(for pagination\) |
| `count` | number | No | A count of items already seen in the listing \(used for numbering\) |
| `show` | string | No | Show items that would normally be filtered \(e.g., "all"\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Name of the subreddit where search was performed |
| `posts` | array | Array of search result posts with title, author, URL, score, comments count, and metadata |
| ↳ `id` | string | Post ID |
| ↳ `title` | string | Post title |
| ↳ `author` | string | Author username |
| ↳ `url` | string | Post URL |
| ↳ `permalink` | string | Reddit permalink |
| ↳ `score` | number | Post score \(upvotes - downvotes\) |
| ↳ `num_comments` | number | Number of comments |
| ↳ `created_utc` | number | Creation timestamp \(UTC\) |
| ↳ `is_self` | boolean | Whether this is a text post |
| ↳ `selftext` | string | Text content for self posts |
| ↳ `thumbnail` | string | Thumbnail URL |
| ↳ `subreddit` | string | Subreddit name |
### `reddit_submit_post`
Submit a new post to a subreddit (text or link)
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The name of the subreddit to post to \(without the r/ prefix\) |
| `title` | string | Yes | Title of the submission \(max 300 characters\) |
| `text` | string | No | Text content for a self post \(markdown supported\) |
| `url` | string | No | URL for a link post \(cannot be used with text\) |
| `nsfw` | boolean | No | Mark post as NSFW |
| `spoiler` | boolean | No | Mark post as spoiler |
| `send_replies` | boolean | No | Send reply notifications to inbox \(default: true\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the post was submitted successfully |
| `message` | string | Success or error message |
| `data` | object | Post data including ID, name, URL, and permalink |
| ↳ `id` | string | New post ID |
| ↳ `name` | string | Thing fullname \(t3_xxxxx\) |
| ↳ `url` | string | Post URL from API response |
| ↳ `permalink` | string | Full Reddit permalink |
### `reddit_vote`
Upvote, downvote, or unvote a Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to vote on \(e.g., t3_xxxxx for post, t1_xxxxx for comment\) |
| `dir` | number | Yes | Vote direction: 1 \(upvote\), 0 \(unvote\), or -1 \(downvote\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the vote was successful |
| `message` | string | Success or error message |
### `reddit_save`
Save a Reddit post or comment to your saved items
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to save \(e.g., t3_xxxxx for post, t1_xxxxx for comment\) |
| `category` | string | No | Category to save under \(Reddit Gold feature\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the save was successful |
| `message` | string | Success or error message |
### `reddit_unsave`
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `subreddit` | string | Subreddit name |
| `posts` | json | Posts data |
| `post` | json | Single post data |
| `comments` | json | Comments data |
### `reddit_reply`
Add a comment reply to a Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `parent_id` | string | Yes | Thing fullname to reply to \(e.g., t3_xxxxx for post, t1_xxxxx for comment\) |
| `text` | string | Yes | Comment text in markdown format |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the reply was posted successfully |
| `message` | string | Success or error message |
| `data` | object | Comment data including ID, name, permalink, and body |
| ↳ `id` | string | New comment ID |
| ↳ `name` | string | Thing fullname \(t1_xxxxx\) |
| ↳ `permalink` | string | Comment permalink |
| ↳ `body` | string | Comment body text |
### `reddit_edit`
Edit the text of your own Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `thing_id` | string | Yes | Thing fullname to edit \(e.g., t3_xxxxx for post, t1_xxxxx for comment\) |
| `text` | string | Yes | New text content in markdown format |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the edit was successful |
| `message` | string | Success or error message |
| `data` | object | Updated content data |
| ↳ `id` | string | Edited thing ID |
| ↳ `body` | string | Updated comment body \(for comments\) |
| ↳ `selftext` | string | Updated post text \(for self posts\) |
### `reddit_delete`
Delete your own Reddit post or comment
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | string | Yes | Thing fullname to delete \(e.g., t3_xxxxx for post, t1_xxxxx for comment\) |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the deletion was successful |
| `message` | string | Success or error message |
### `reddit_subscribe`
Subscribe or unsubscribe from a subreddit
#### Input
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `subreddit` | string | Yes | The name of the subreddit \(without the r/ prefix\) |
| `action` | string | Yes | Action to perform: "sub" to subscribe or "unsub" to unsubscribe |
#### Output
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `success` | boolean | Whether the subscription action was successful |
| `message` | string | Success or error message |