Skip to content

fix(linear): align tool outputs, queries, and pagination with API#3150

Merged
waleedlatif1 merged 2 commits intostagingfrom
fix/pagination
Feb 6, 2026
Merged

fix(linear): align tool outputs, queries, and pagination with API#3150
waleedlatif1 merged 2 commits intostagingfrom
fix/pagination

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Added cursor-based pagination (first/after + pageInfo) to all list tools missing it
  • Aligned all GraphQL queries with SDK entity types (added missing fields like updatedAt, createdAt, slugId, revenue, etc.)
  • Added shared output property constants to create/update tools that were missing them
  • Fixed type interfaces (CustomerStatus, ProjectStatus, Attachment) to match SDK
  • Re-added displayName as input-only param for customer status create/update
  • Updated block config to pass new params

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Feb 6, 2026 2:33am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

This PR systematically aligns all Linear tool implementations with the Linear GraphQL API and SDK entity types.

Key changes:

  • Added cursor-based pagination (first/after + pageInfo) to 13 list operations that were missing it
  • Expanded GraphQL queries to include missing SDK fields (updatedAt, createdAt, slugId, revenue, size, progress, sortOrder, status, etc.)
  • Introduced shared output property constants in types.ts for consistent tool responses
  • Fixed type interfaces: removed displayName from CustomerStatus output (not returned by API), re-added it as input-only parameter for create/update operations
  • Updated block config to properly pass pagination parameters to all list tools
  • Improved response transformations with proper field mapping (e.g., projectId extraction in milestones)

The changes ensure tools accurately reflect what the Linear API returns and accept, improving data completeness and enabling proper pagination across all list endpoints.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The changes are systematic, well-structured, and focused on aligning with the Linear API. All modifications follow consistent patterns, add missing fields to match SDK types, and properly implement pagination. The code maintains backward compatibility while improving data completeness.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/linear/types.ts Comprehensive type definitions and shared output properties added for better consistency across Linear tools
apps/sim/tools/linear/list_customer_statuses.ts Added cursor-based pagination and aligned query fields with SDK (removed displayName, added type and updatedAt)
apps/sim/tools/linear/list_project_milestones.ts Added pagination and expanded query fields (progress, sortOrder, status) with proper projectId mapping
apps/sim/tools/linear/create_customer_status.ts Added displayName as input-only parameter and expanded output fields (type, updatedAt)
apps/sim/tools/linear/update_project_milestone.ts Added missing fields, proper projectId mapping, and improved error handling
apps/sim/blocks/blocks/linear.ts Expanded pagination params to all list operations and properly coerced first param to number

Sequence Diagram

sequenceDiagram
    participant User
    participant Block as Linear Block
    participant Tool as Linear Tool
    participant API as Linear GraphQL API

    Note over User,API: Example: List Customer Statuses with Pagination

    User->>Block: Request list_customer_statuses
    Block->>Block: Coerce first param to Number
    Block->>Tool: Pass params (first, after, accessToken)
    Tool->>Tool: Build GraphQL query with pagination
    Tool->>API: POST /graphql (first: 50, after: cursor)
    API-->>Tool: Return nodes + pageInfo (hasNextPage, endCursor)
    Tool->>Tool: Transform response with pageInfo
    Tool-->>Block: Return {customerStatuses, pageInfo}
    Block-->>User: Output results + pagination info

    Note over User,API: Enhanced with SDK-aligned fields

    User->>Block: Request create_customer_status
    Block->>Tool: Pass params (name, color, displayName)
    Note over Tool: displayName is input-only
    Tool->>API: POST /graphql (create mutation)
    API-->>Tool: Return status (without displayName)
    Note over Tool: Output includes type, updatedAt
    Tool-->>Block: Return SDK-aligned customerStatus
    Block-->>User: Output complete entity
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 6, 2026

Additional Comments (1)

apps/sim/blocks/blocks/linear.ts
Pagination inputs typed as string

first/after block params are defined as type: 'short-input', which typically yields string values, but many Linear tools declare first as a number param and pass it straight into GraphQL (e.g. variables.first: params.first || 50). If first comes through as a non-empty string (e.g. '10'), params.first || 50 will remain a string and GraphQL will reject it (Int expected). Consider switching first to a numeric input type (if available) or consistently coercing with Number(params.first) in every tool that uses first/after.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/blocks/blocks/linear.ts
Line: 807:810

Comment:
**Pagination inputs typed as string**

`first`/`after` block params are defined as `type: 'short-input'`, which typically yields string values, but many Linear tools declare `first` as a `number` param and pass it straight into GraphQL (e.g. `variables.first: params.first || 50`). If `first` comes through as a non-empty string (e.g. `'10'`), `params.first || 50` will remain a string and GraphQL will reject it (`Int` expected). Consider switching `first` to a numeric input type (if available) or consistently coercing with `Number(params.first)` in every tool that uses `first`/`after`.


How can I resolve this? If you propose a fix, please make it concise.

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit c0b22a6 into staging Feb 6, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/pagination branch February 6, 2026 02:44
waleedlatif1 added a commit that referenced this pull request Feb 6, 2026
)

* fix(linear): align tool outputs, queries, and pagination with API

* fix(linear): coerce first param to number, remove duplicate conditions, add null guard
waleedlatif1 added a commit that referenced this pull request Feb 6, 2026
* feat(skills): added skills to agent block

* improvement(skills): audit fixes, docs, icon, and UX polish

* fix(skills): consolidate redundant permission checks in POST and DELETE

* more friendly error for duplicate skills in the same workspace

* fix(executor):  loop sentinel-end wrongly queued (#3148)

* fix(executor):  loop sentinel-end wrongly queued

* fix nested subflow error highlighting

* fix(linear): align tool outputs, queries, and pagination with API (#3150)

* fix(linear): align tool outputs, queries, and pagination with API

* fix(linear): coerce first param to number, remove duplicate conditions, add null guard

* fix(resolver): response format and evaluator metrics in deactivated branch (#3152)

* fix(resolver): response format in deactivated branch

* add evaluator metrics too

* add child workflow id to the workflow block outputs

* cleanup typing

* feat(slack): add file attachment support to slack webhook trigger (#3151)

* feat(slack): add file attachment support to slack webhook trigger

* additional file handling

* lint

* ack comment

* fix(skills): hide skill selection when disabled, remove dead code

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
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