Skip to main content
Glama

bear_context_import

Import markdown content from external sources like Jira, Slack, or API docs into the Bear context library. Each entry includes source, group, summary, and date metadata.

Instructions

Import external content into the context library. Content is written to the external/ directory with YAML front matter (source, group, summary, date). Use this to add non-Bear content like Jira tickets, Slack threads, API docs, or any markdown. The content is passed via stdin and a filename must be provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesTarget filename in external/ (e.g., 'jira-ticket-123.md')
contentYesMarkdown content to import
groupNoGroup label for organizing (e.g., 'jira', 'slack', 'docs')
sourceNoSource description (e.g., URL, tool name)
summaryNoShort summary of the content

Implementation Reference

  • Registration of bear_context_import tool in the tools registry. Exports the tool definition, input schema, args builder, and stdin handler.
    bear_context_import: {
      tool: {
        name: "bear_context_import",
        description:
          "Import external content into the context library. Content is written to the external/ directory with YAML front matter (source, group, summary, date). Use this to add non-Bear content like Jira tickets, Slack threads, API docs, or any markdown. The content is passed via stdin and a filename must be provided.",
        inputSchema: {
          type: "object" as const,
          properties: {
            filename: {
              type: "string",
              description:
                "Target filename in external/ (e.g., 'jira-ticket-123.md')",
            },
            content: {
              type: "string",
              description: "Markdown content to import",
            },
            group: {
              type: "string",
              description:
                "Group label for organizing (e.g., 'jira', 'slack', 'docs')",
            },
            source: {
              type: "string",
              description:
                "Source description (e.g., URL, tool name)",
            },
            summary: {
              type: "string",
              description: "Short summary of the content",
            },
          },
          required: ["filename", "content"],
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: false,
        },
      },
      buildArgs: (input) => {
        const args = ["context", "import", "--stdin", "--json"];
        if (input.filename) args.push("--filename", String(input.filename));
        if (input.group) args.push("--group", String(input.group));
        if (input.source) args.push("--source", String(input.source));
        if (input.summary) args.push("--summary", String(input.summary));
        return args;
      },
      usesStdin: (input) => (input.content ? String(input.content) : null),
    },
  • Input schema for bear_context_import: accepts filename (required), content (required), group, source, and summary.
    inputSchema: {
      type: "object" as const,
      properties: {
        filename: {
          type: "string",
          description:
            "Target filename in external/ (e.g., 'jira-ticket-123.md')",
        },
        content: {
          type: "string",
          description: "Markdown content to import",
        },
        group: {
          type: "string",
          description:
            "Group label for organizing (e.g., 'jira', 'slack', 'docs')",
        },
        source: {
          type: "string",
          description:
            "Source description (e.g., URL, tool name)",
        },
        summary: {
          type: "string",
          description: "Short summary of the content",
        },
      },
      required: ["filename", "content"],
    },
  • Handler logic: builds CLI args for the 'context import' subcommand and pipes content via stdin. Invokes external bcli tool.
    buildArgs: (input) => {
      const args = ["context", "import", "--stdin", "--json"];
      if (input.filename) args.push("--filename", String(input.filename));
      if (input.group) args.push("--group", String(input.group));
      if (input.source) args.push("--source", String(input.source));
      if (input.summary) args.push("--summary", String(input.summary));
      return args;
    },
  • Helper that executes bcli with stdin data (used for the content parameter) and automatic re-authentication on auth errors.
    export async function execBcliWithStdinAndReauth(
      args: string[],
      input: string,
    ): Promise<{ stdout: string; stderr: string }> {
      try {
        return await execBcliWithStdin(args, input);
      } catch (error) {
        if (error instanceof AuthError) {
          await performReauth();
          return await execBcliWithStdin(args, input);
        }
        throw error;
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description states that content is written to the external/ directory, which is a behavioral trait. Annotations are sparse (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the description carries burden. It does not mention behavior on file overwrite or errors, and the mention of 'passed via stdin' may conflict with the content parameter in the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: first states the core function, second provides usage examples and method. Every sentence is necessary and informative, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the 5 parameters and no output schema, the description covers purpose, examples, and method. It could be more complete by mentioning prerequisites (e.g., directory existence) or error handling, but it is mostly sufficient for an import tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so parameters are documented. The description adds value by explaining that content is passed via stdin and that group, source, and summary are used for YAML front matter. This goes beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool imports external content into the context library and writes to external/ with YAML front matter. It provides examples (Jira, Slack, API docs) and distinguishes from siblings by focusing on non-Bear content. However, it could more explicitly differentiate from similar tools like bear_context_add or bear_context_ingest.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description tells when to use the tool (for non-Bear content) but does not explicitly state when not to use it or suggest alternatives like bear_create_note or bear_context_add. The guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KuvopLLC/better-bear'

If you have feedback or need assistance with the MCP directory API, please join our Discord server