> ## Documentation Index
> Fetch the complete documentation index at: https://docs.danubeai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Context

> What an agent should know before it works for you: organization and personal context, merged

## Overview

Returns the caller's [context](/organizations/context): the documents of the organization the request acts for (written by its owners and admins in the dashboard), the caller's personal documents, the skills the agent can load and the caller's timezone. `markdown` is all of it merged into one text, organization first, the way an agent reads it at the start of a session.

**Which organization:** the acting organization (the `danube-org-id` header, or an organization API key). With neither, a caller in exactly one shared organization gets that one; a caller in several gets no organization layer and a `note`. A personal organization has no organization layer.

**Auth:** API key (`danube-api-key` header) or dashboard session (JWT).

## Query Parameters

<ParamField query="include_skills" type="boolean" default="true">
  Also list the organization's internal skills and your private ones, by name and description
</ParamField>

<ParamField query="format" type="string" default="json">
  `json` for the object below, or `markdown` for only the merged text (`text/markdown`)
</ParamField>

## Response

<ResponseField name="markdown" type="string">
  The organization layer, the personal layer, the skill index and the timezone, merged. Empty layers are left out.
</ResponseField>

<ResponseField name="characters" type="integer">
  Length of `markdown`
</ResponseField>

<ResponseField name="approx_tokens" type="integer">
  Rough token count of `markdown` (characters / 4)
</ResponseField>

<ResponseField name="organization" type="object | null">
  The organization layer: `id`, `name`, `slug`, your `role`, `can_edit` (owner or admin) and `documents`. Null when no organization applies.
</ResponseField>

<ResponseField name="personal" type="object">
  `documents`: your own context documents. Each document has `id`, `name`, `content`, `version`, `position`, `updated_at`, `updated_via` (`dashboard`, `api` or `agent`) and `updated_by`.
</ResponseField>

<ResponseField name="skills" type="array">
  Skills the agent can load: `id`, `name`, `description` and `source` (`organization` or `personal`)
</ResponseField>

<ResponseField name="timezone" type="string | null">
  Your IANA timezone, set with `PUT /v1/context/timezone`
</ResponseField>

<ResponseField name="organizations" type="array">
  The shared organizations you belong to (`id`, `name`, `slug`, `role`)
</ResponseField>

<ResponseField name="note" type="string | null">
  Set when you belong to several organizations and none was selected
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.danubeai.com/v1/context" \
    -H "danube-api-key: YOUR_DANUBE_API_KEY"

  # Only the merged text
  curl "https://api.danubeai.com/v1/context?format=markdown" \
    -H "danube-api-key: YOUR_DANUBE_API_KEY"
  ```

  ```python Python SDK theme={null}
  from danube import DanubeClient

  with DanubeClient(api_key="YOUR_DANUBE_API_KEY") as client:
      context = client.context.get()
      print(context.markdown)
  ```

  ```typescript TypeScript SDK theme={null}
  import { DanubeClient } from 'danube';

  const client = new DanubeClient({ apiKey: 'YOUR_DANUBE_API_KEY' });
  const context = await client.context.get();
  console.log(context.markdown);
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "markdown": "# Organization context: Acme\n\n<!-- company.md -->\nAcme sells industrial anvils to...\n\n# Personal context\n\n<!-- notes.md -->\nI lead the support team.\n\nTimezone: Europe/Oslo",
    "characters": 142,
    "approx_tokens": 36,
    "organization": {
      "id": "5b0c...",
      "name": "Acme",
      "slug": "acme",
      "role": "member",
      "can_edit": false,
      "documents": [
        {
          "id": "d1f2...",
          "name": "company.md",
          "content": "Acme sells industrial anvils to...",
          "version": 4,
          "position": 0,
          "updated_at": "2026-09-27T09:12:00Z",
          "updated_via": "dashboard",
          "updated_by": "a8e1..."
        }
      ]
    },
    "personal": {
      "documents": [
        {
          "id": "77aa...",
          "name": "notes.md",
          "content": "I lead the support team.",
          "version": 2,
          "position": 0,
          "updated_at": "2026-09-27T10:03:00Z",
          "updated_via": "agent",
          "updated_by": "a8e1..."
        }
      ]
    },
    "skills": [],
    "timezone": "Europe/Oslo",
    "organizations": [{ "id": "5b0c...", "name": "Acme", "slug": "acme", "role": "member" }],
    "note": null
  }
  ```
</ResponseExample>

## MCP

The MCP server offers the same bundle as the `get_context` tool (in the `core` group) and as the resource `context://current` (the merged markdown).
