get_document
Retrieve document details from Backlog projects using its unique ID to access information and content.
Instructions
Gets information about a document.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentId | Yes | Document ID |
Implementation Reference
- src/tools/getDocument.ts:29-31 (handler)The handler function that implements the core logic of the 'get_document' tool by retrieving the document using the Backlog client's getDocument method.handler: async ({ documentId }) => { return backlog.getDocument(documentId); },
- src/tools/getDocument.ts:7-11 (schema)The Zod input schema definition for the 'get_document' tool, specifying the required 'documentId' string parameter.const getDocumentSchema = buildToolSchema((t) => ({ documentId: z .string() .describe(t('TOOL_GET_DOCUMENT_DOCUMENT_ID', 'Document ID')), }));
- src/tools/tools.ts:151-155 (registration)Registration of the 'get_document' tool within the 'document' toolset group by calling its factory function getDocumentTool and adding it to the tools array.tools: [ getDocumentsTool(backlog, helper), getDocumentTreeTool(backlog, helper), getDocumentTool(backlog, helper), ],
- src/tools/getDocument.ts:13-33 (registration)The factory function that creates and defines the ToolDefinition object for 'get_document', including name, description, schema, and handler.export const getDocumentTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getDocumentSchema>, (typeof DocumentItemSchema)['shape'] > => { return { name: 'get_document', description: t( 'TOOL_GET_DOCUMENT_DESCRIPTION', 'Gets information about a document.' ), schema: z.object(getDocumentSchema(t)), outputSchema: DocumentItemSchema, importantFields: ['id', 'title', 'createdUser'], handler: async ({ documentId }) => { return backlog.getDocument(documentId); }, }; };