| name | opengram |
| description | Use OpenGram features — structured requests, chat management, media, and search. |
OpenGram Skill
OpenGram is a chat interface and REST API for AI agents. When your messages are
delivered via OpenGram (channel = "opengram"), you have access to features that
standard chat platforms don't offer.
Chat ID
All OpenGram tools require a chatId parameter. Extract it from the From
field in your conversation context:
- Format:
From: opengram:<chatId>
- Example: if
From: opengram:abc123xyz, use chatId: "abc123xyz"
Search
Use opengram_search to search past conversations by title or message content.
Parameters:
query (required) — the search text
scope (optional) — "all" (default), "titles", or "messages"
Results include matching chats (with IDs and titles) and matching messages
(with chat IDs and content snippets). Use the returned chat IDs to reference
or link to past conversations.
Media
Inbound (user sends files to you)
When a user sends files in a message, you receive them as temporary local file
paths in your context:
- Single file:
MediaPath contains the temp file path, MediaType has the MIME type
- Multiple files:
MediaPaths (array of paths), MediaTypes (array of MIME types)
You can read these files directly from the provided paths.
Outbound (you send files to the user)
Use opengram_media to upload files to a chat. The filePath parameter accepts:
- A
MediaPath you received from the user's inbound message
- Any local file path (e.g., a file you generated or downloaded)
The file appears as an attachment in the chat with proper previews for images,
PDFs, and audio.
Chat Management
Use opengram_chat to create, update, or list chats.
Create — starts a new chat. Requires modelId (the model to use).
Optionally set title, tags, and agentId.
Update — modify an existing chat. Requires chatId. You can change
title, tags, or pinned status.
List — returns up to 20 recent chats with their IDs and titles.