Skip to content

feat: add support for Linear documents API #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

darinkishore
Copy link

Summary

This PR adds comprehensive support for Linear's documents API, allowing users to create, read, update, and delete documents through the MCP server.

Features

  • Document listing with filtering by name, team, or project
  • Document retrieval with full content or preview
  • Document creation with flexible options
  • Document updates including archiving capabilities
  • Document deletion
  • Comprehensive test coverage

Implementation Details

  • Follow consistent service-based architecture pattern
  • Well-documented MCP tools with examples
  • Strong typing throughout for API safety
  • Error handling consistent with existing patterns

All tests are passing and documentation is included in the tool schema descriptions.

@cosmix cosmix requested a review from Copilot May 13, 2025 13:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive support for Linear's documents API, enabling CRUD operations on documents through the MCP server. Key changes include new type definitions and guards for documents, implementation of document operations in the Linear API service and a dedicated document service, as well as updated test coverage and CLI command integrations.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types/linear/index.ts Updated exports to include document types alongside other entities.
src/types/linear/guards.ts Added document-specific type guards for argument validation.
src/types/linear/document.ts Introduced interfaces for document operations and responses.
src/services/linear/index.ts Integrated document service methods into the API service.
src/services/linear/document-service.ts Implemented CRUD operations for documents with input handling and error management.
src/services/linear/base-service.ts Extended the client interface to support document related methods.
src/services/tests/test-utils.ts Added mocks for document methods.
src/services/tests/linear-api-document-management.test.ts Added comprehensive tests for document management functionality.
src/index.ts Updated command registration and handlers for document API endpoints.

if (args.isPublic !== undefined) input.isPublic = args.isPublic;

// Create document
const result = await (this.client as any).createDocument(input);
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The createDocument call is missing the required wrapper object; tests expect the input to be passed as { input: ... } instead of directly as input. Consider updating the call to (this.client as any).createDocument({ input }).

Suggested change
const result = await (this.client as any).createDocument(input);
const result = await (this.client as any).createDocument({ input });

Copilot uses AI. Check for mistakes.

if (args.isPublic !== undefined) input.isPublic = args.isPublic;

// Update document
const result = await (this.client as any).documentUpdate(input);
Copy link
Preview

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentUpdate call is missing the expected input wrapper; tests expect the parameter to be passed as { input: ... }. Consider changing the call to (this.client as any).documentUpdate({ input }).

Suggested change
const result = await (this.client as any).documentUpdate(input);
const result = await (this.client as any).documentUpdate({ input });

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant