Skip to main content
Glama
nulab

Backlog MCP Server

addDocument

Add a new document to a Backlog project. Specify project ID, title, content, and optionally emoji or parent document.

Instructions

Adds a new document to the specified project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
titleNoTitle of the document
contentNoContent of the document
emojiNoEmoji for the document
parentIdNoParent document ID
addLastNoAdd to the end of the list
organizationNoOptional organization name. Use list_organizations to inspect available organizations.

Implementation Reference

  • The main handler function for the addDocument tool. It takes a Backlog client and TranslationHelper, returns a ToolDefinition with name 'addDocument', schema, outputSchema (DocumentItemSchema), and a handler that calls backlog.addDocument(params).
    export const addDocumentTool = (
      backlog: Backlog,
      { t }: TranslationHelper
    ): ToolDefinition<
      ReturnType<typeof addDocumentSchema>,
      (typeof DocumentItemSchema)['shape']
    > => {
      return {
        name: 'addDocument',
        description: t(
          'TOOL_ADD_DOCUMENT_DESCRIPTION',
          'Adds a new document to the specified project.'
        ),
        schema: z.object(addDocumentSchema(t)),
        outputSchema: DocumentItemSchema,
        importantFields: ['id', 'projectId', 'title', 'plain', 'createdUser'],
        handler: async (params) => {
          return backlog.addDocument(params);
        },
      };
    };
  • Input schema for the addDocument tool defining fields: projectId (number, required), title (string, optional), content (string, optional), emoji (string, optional), parentId (string, optional), and addLast (boolean, optional).
    const addDocumentSchema = buildToolSchema((t) => ({
      projectId: z
        .number()
        .describe(t('TOOL_ADD_DOCUMENT_PROJECT_ID', 'Project ID')),
      title: z
        .string()
        .optional()
        .describe(t('TOOL_ADD_DOCUMENT_TITLE', 'Title of the document')),
      content: z
        .string()
        .optional()
        .describe(t('TOOL_ADD_DOCUMENT_CONTENT', 'Content of the document')),
      emoji: z
        .string()
        .optional()
        .describe(t('TOOL_ADD_DOCUMENT_EMOJI', 'Emoji for the document')),
      parentId: z
        .string()
        .optional()
        .describe(t('TOOL_ADD_DOCUMENT_PARENT_ID', 'Parent document ID')),
      addLast: z
        .boolean()
        .optional()
        .describe(t('TOOL_ADD_DOCUMENT_ADD_LAST', 'Add to the end of the list')),
    }));
  • DocumentItemSchema - the output/response schema for the addDocument tool. Defines the shape of the returned document object with fields: id, projectId, title, plain, json, statusId, emoji, attachments, tags, createdUser, created, updatedUser, updated.
    export const DocumentItemSchema = z.object({
      id: z.string(),
      projectId: z.number(),
      title: z.string(),
      plain: z.string(),
      json: z.string(),
      statusId: z.number(),
      emoji: z.string().nullable(),
      attachments: z.array(DocumentFileInfoSchema),
      tags: z.array(DocumentTagSchema),
      createdUser: UserSchema,
      created: z.string(),
      updatedUser: UserSchema,
      updated: z.string(),
    });
  • Registration of addDocumentTool within the 'document' toolset group in the allTools function. The toolset is disabled by default.
    {
      name: 'document',
      description: 'Tools for managing documents.',
      enabled: false,
      tools: [
        getDocumentsTool(backlog, helper),
        getDocumentTreeTool(backlog, helper),
        getDocumentTool(backlog, helper),
        addDocumentTool(backlog, helper),
      ],
    },
  • Import statement for addDocumentTool from './addDocument.js' in the tools aggregation module.
    import { addDocumentTool } from './addDocument.js';
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits. It states 'Adds,' implying creation, but does not disclose permissions, side effects (e.g., overwriting existing documents), or whether the operation is reversible. This is insufficient for safe invocation.

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

Conciseness4/5

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

The description is a single, concise sentence that front-loads the key action. It is appropriately sized for the tool's complexity, with no wasted words.

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

Completeness2/5

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

Given the tool has 7 parameters, no output schema, and no annotations, the description is too sparse. It does not explain return values, error behavior, or what happens when required inputs are invalid. A more comprehensive description would improve completeness.

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?

With 100% schema coverage, the input schema already describes each parameter. The tool description adds no extra meaning beyond the schema, meeting the baseline expectation. No additional parameter relationships or constraints are noted.

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 'Adds a new document to the specified project' clearly states the verb and resource, making the tool's purpose obvious. However, it does not differentiate this tool from siblings like add_issue or add_project, which is acceptable given the distinct name.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like add_issue or add_project, nor does it mention any prerequisites or context. Agents receive no help in deciding between sibling tools.

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/nulab/backlog-mcp-server'

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