Skip to main content
Glama

agentbay_knowledge_export

Export all knowledge for a project to onboard new agents, restore memory, or sync to local storage. Supports filters by source, type, and date.

Instructions

Export all knowledge for a project. Use for onboarding a new agent, restoring memory, or syncing to local store.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
sourceNoFilter to entries from a specific agent
typesNo
sinceNoISO date — only entries updated after this timestamp
includeDeprecatedNoInclude deprecated entries (default false)

Implementation Reference

  • The core implementation of the agentbay_knowledge_export tool. It registers an MCP tool with schema (projectId, source, types, since, includeDeprecated), builds query params, calls GET /api/v1/projects/{projectId}/knowledge/export, and formats the response as markdown text.
    // Tool 26: Knowledge Export
    server.tool(
      'agentbay_knowledge_export',
      'Export all knowledge for a project. Use for onboarding a new agent, restoring memory, or syncing to local store.',
      {
        projectId: z.string().describe('Project ID'),
        source: z.string().optional().describe('Filter to entries from a specific agent'),
        types: z.array(z.enum(['PATTERN', 'PITFALL', 'ARCHITECTURE', 'DEPENDENCY', 'TEST_INSIGHT', 'PERFORMANCE', 'DECISION', 'CONTEXT'])).optional(),
        since: z.string().optional().describe('ISO date — only entries updated after this timestamp'),
        includeDeprecated: z.boolean().optional().describe('Include deprecated entries (default false)'),
      },
      async ({ projectId, source, types, since, includeDeprecated }) => {
        const params = new URLSearchParams();
        if (source) params.set('source', source);
        if (types?.length) params.set('types', types.join(','));
        if (since) params.set('since', since);
        if (includeDeprecated) params.set('includeDeprecated', 'true');
        const data = await apiGet(`/api/v1/projects/${projectId}/knowledge/export?${params.toString()}`);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        const entries = data.knowledge || [];
        if (!entries.length) return { content: [{ type: 'text' as const, text: 'No knowledge entries found.' }] };
        const text = entries.map((k: any) =>
          `### ${k.title} (${k.type})\nSource: ${k.source || 'unknown'} | Key: ${k.sourceRef || 'none'} | Confidence: ${k.confidence}\n${k.content}\n_Tags: ${k.tags?.join(', ') || 'none'} | Updated: ${k.updatedAt}_`
        ).join('\n\n---\n\n');
        return { content: [{ type: 'text' as const, text: `Exported ${entries.length} entries from "${data.project?.name}":\n\n${text}` }] };
      }
    );
  • Input schema for agentbay_knowledge_export: projectId (required string), source (optional string), types (optional enum array), since (optional ISO date string), includeDeprecated (optional boolean).
    server.tool(
      'agentbay_knowledge_export',
      'Export all knowledge for a project. Use for onboarding a new agent, restoring memory, or syncing to local store.',
      {
        projectId: z.string().describe('Project ID'),
        source: z.string().optional().describe('Filter to entries from a specific agent'),
        types: z.array(z.enum(['PATTERN', 'PITFALL', 'ARCHITECTURE', 'DEPENDENCY', 'TEST_INSIGHT', 'PERFORMANCE', 'DECISION', 'CONTEXT'])).optional(),
        since: z.string().optional().describe('ISO date — only entries updated after this timestamp'),
        includeDeprecated: z.boolean().optional().describe('Include deprecated entries (default false)'),
      },
  • src/index.ts:809-811 (registration)
    Registration of the 'agentbay_knowledge_export' tool on the MCP server via server.tool() call, binding the name, description, schema, and handler.
    // Tool 26: Knowledge Export
    server.tool(
      'agentbay_knowledge_export',
Behavior3/5

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

No annotations; description covers export and filtering via parameters, but lacks details on side effects, data volume, or performance implications. Adequate but not rich.

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?

Single sentence clearly stating purpose and use cases, no wasted words. Efficient and front-loaded.

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

Completeness3/5

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

No output schema; description does not specify return format, limits, or behavior when filters are omitted. Adequate for core purpose but leaves gaps.

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

Parameters3/5

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

Schema coverage is 80%; description adds 'all knowledge' context but does not elaborate on parameter semantics beyond what the schema provides. Baseline 3 is appropriate.

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

Purpose5/5

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

Clearly states the tool exports all knowledge for a project, with specific use cases (onboarding, restoring memory, syncing). Distinguishes from sibling tools like knowledge_query and knowledge_manage.

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?

Lists three use cases but does not explicitly state when not to use or mention alternatives. Context is implied by sibling tool names, but no direct guidance.

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/thomasjumper/agentbay-mcp'

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