Context Manager Server
Read the business context Sona uses when it writes articles for an AI Visibility brand: how complete each context file is, which questions are answered or need a recheck, the rules every article follows, and where each answer came from.
Overview
The Context Manager Server exposes Context Manager data over MCP. In the Sona app, the same data is on Data → Context Manager. The server is read-only: no tool adds, edits, confirms, or deletes anything.
Server Details
- Server Name:
context-manager-server - Endpoint:
POST https://ask.sonalabs.com/mcp/context-manager - Transport: Streamable HTTP
- Authentication:
x-api-keyheader with your organization's Ask Your Data API Key. - Scoping: All data is automatically scoped to the organization that owns the API key. A brand from another organization returns "not found".
- Access: Read-only.
Purpose
Answer questions about a brand's article context: how complete it is, which files need work, what Sona knows about the company, offerings, competitors, audience, and strategy, which questions are unanswered or out of date, and which source filled an answer.
Data Model
- Brands: Context Manager data belongs to an AI Visibility brand, so most tools need a
brandId. - Context files: every brand has the same five files:
- Company: who the business is, how it sounds, and the rules every article follows.
- Offerings: what it sells, where each product lives, and which claims are allowed.
- Competitor: who it competes with and how Sona compares them.
- Audience: who articles are written for and the doubts they need to answer.
- Strategy: which searches to write for and what matters this quarter.
- Questions: live inside a file, and each has one answer. A question comes from a template (the general set plus optional industry sets such as B2B SaaS or E-commerce), is added by a user, or is added when Sona reads a source.
- Example answers: placeholders from an industry template. They don't count as answered until a user replaces them.
- Synced answers: answers in the Company file that are filled automatically from the brand's AI Visibility data (saved prompts, engines covered, cited share). Users can't edit them.
- Needs recheck: the answer is older than its recheck window (every N days, 42 by default), or a source now says something different. The stored answer doesn't change until a user reviews it.
- Rules: instructions every article must follow. Hard rules must never be broken.
- Sources: what Sona reads to fill the files: an uploaded file (PDF, DOCX, TXT, MD, CSV), a web address, or the onboarding answers (added by Sona).
Brand ID
Every tool except Brands List and Context Source needs a brandId.
- If a Brand ID is already given (in the system prompt, earlier in the conversation, or by the user), the assistant uses it directly. It doesn't call Brands List and doesn't ask which brand.
- Only when no brand ID was given does it call Brands List. With one brand, it uses that brand. With several and no brand named in the question, it asks the user.
Which Tool Answers What
| Question | Tool |
|---|---|
| How complete is the brand's context? Which files need work? | Context Overview |
| What does Sona know about the company, offerings, competitors, audience, or strategy? | Context File (contentOnly returns just the questions and full answers as a document) |
| Which questions are unanswered or need a recheck? | Context File with the status filter |
| Where did an answer come from? What did a source fill? | Context Source (the source ID comes from Context File) |
| What does an uploaded source file say? | Context Source with includeContent (TXT, MD, CSV, and DOCX; not PDFs) |
| The organization's brands (only when no brand ID was given) | Brands List |
Recommended Workflow
- Call Context Overview to see how complete each file is.
- Call Context File for the files that need work.
- Call Context Source to find out where an answer came from, or with
includeContentto read what an uploaded file says.
Every tool returns formatted Markdown (a table with a short note underneath, or a document for Context File with contentOnly), so responses render directly in the assistant's answer without extra formatting work.
Available Tools
1. brands-list-tool
Purpose: List every AI Visibility brand for the organization.
Input: None required.
Returns: ID, name, URL, topic count, prompt count.
When to use: Only when no brand ID was given. This is the same tool as on the AI Visibility Server.
2. context-overview-tool
Purpose: Summarize how complete a brand's context is.
Input: brandId (required).
Returns: for each of the five files, answered / total questions, health (Empty / Needs work / Good), last updated date, and purpose. Also returns whether the brand finished the first-time setup, the suggested industry set, and the industry template sets available.
When to use: Start here for any "how complete is our context?" or "which files need work?" question.
3. context-file-tool
Purpose: Read every question in one context file.
Input:
brandId(required)fileSlug(required):company,offerings,competitor,audience, orstrategystatus(optional):all(default),answered,unanswered,needsRecheckcontentOnly(optional, defaultfalse): return the file as a document instead of a table
Returns: questions grouped as on the page (the file's sections, industry sets, "Added by you", "Added from sources"). Each row has the question ID, question, full answer, state, answer source, source ID, last checked date, recheck setting, and flags (Rule / Hard rule / Style / Blocks article).
With contentOnly, the file comes back as a document instead: each question is a heading with its full answer underneath (line breaks kept) and its rule flags next to the question, without the state, source, and recheck details.
When to use: To see what Sona knows about one area, or with status to find gaps and stale answers. Use contentOnly to read the file's questions and full answers as a document.
4. context-source-tool
Purpose: Get the detail of one source.
Input:
sourceId(required). Get it from the Source ID column ofcontext-file-tool.includeContent(optional, defaultfalse): also return the text of an uploaded file
Returns: type (File / Web address / Onboarding), file name, web address, read status and error, the files it feeds, items found, whether it was added by Sona, last read and added dates, plus every question it created or answered.
With includeContent, it also adds a File Content section with the text of the uploaded file: TXT, MD, and CSV as uploaded, and DOCX as its body text (one paragraph per line), cut to the first 100,000 characters. PDFs, web addresses, and onboarding sources get a note saying why there is no text.
When to use: To trace where an answer came from, what a given source filled in, or what an uploaded file says.
Answer States
The state column in context-file-tool uses these values:
| State | Meaning |
|---|---|
| Answered | There is an answer. |
| Confirmed | A user marked the answer "Still correct". |
| Unanswered | There is no answer yet. |
| Example (not answered) | A placeholder from an industry template. |
| Needs recheck | The recheck window passed, or a source now says something different. |
| Synced from AI Visibility | Filled automatically from AI Visibility data. "Synced (no value yet)" means there's no data yet. "Synced (tracked, not used in articles)" is the cited share, which is tracked but never written into articles. |
Notes
- All data is automatically scoped to the authenticated organization.
- The server is read-only. To add, edit, confirm, or delete questions or sources, use Data → Context Manager in the Sona app.
- There's no tool to list sources. Reach a source through the Source ID column of
context-file-tool. - Reading the Company file can refresh synced answers from AI Visibility data, at most once an hour per brand. No user-entered content is changed.
- No PDF text yet.
includeContentreturns text for TXT, MD, CSV, and DOCX uploads only. A PDF source returns "Text is not available for .pdf files yet." - The text of an uploaded file is also available as a REST API for external integrations. See the Context Source File Content API reference. The MCP server doesn't call this public endpoint.
Connecting a Client
The Context Manager Server is a remote HTTP MCP server. See the Claude Integration guide to connect it to Claude Code, Claude Desktop, or claude.ai (use https://ask.sonalabs.com/mcp/context-manager as the URL), or the LLM Integration Guide for OpenAI.