create_post
Publish posts on Reddit using specified subreddit, title, content, flair, and post type. Manage self or link posts efficiently with input validation and error handling.
Instructions
Create a new post in a subreddit.
Args:
subreddit: Name of the subreddit to post in (with or without 'r/' prefix)
title: Title of the post (max 300 characters)
content: Content of the post (text for self posts, URL for link posts)
flair: Flair to add to the post. Must be an available flair in the subreddit
is_self: Whether this is a self (text) post (True) or link post (False)
Returns:
Dictionary containing information about the created post
Raises:
ValueError: If input validation fails or flair is invalid
RuntimeError: For other errors during post creation
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | Yes | ||
flair | No | ||
is_self | No | ||
subreddit | Yes | ||
title | Yes |
Input Schema (JSON Schema)
{
"properties": {
"content": {
"title": "Content",
"type": "string"
},
"flair": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Flair"
},
"is_self": {
"default": true,
"title": "Is Self",
"type": "boolean"
},
"subreddit": {
"title": "Subreddit",
"type": "string"
},
"title": {
"title": "Title",
"type": "string"
}
},
"required": [
"subreddit",
"title",
"content"
],
"title": "create_postArguments",
"type": "object"
}