Skip to content

Commit d9b4a4a

Browse files
committed
Enhancement: Tasklist - Add show_completed filter to list_tasklists
Completed tasklists are excluded by the API by default, so the MCP client could not see them. Expose a show_completed parameter on list_tasklists that maps to the SDK's ShowCompleted filter, letting callers opt in to completed tasklists. Related to: Teamwork/twapi-go-sdk#103
1 parent 65ee933 commit d9b4a4a

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/modelcontextprotocol/go-sdk v1.6.1
1414
github.com/teamwork/desksdkgo v1.0.1
1515
github.com/teamwork/spacessdkgo v0.0.0-20260518181558-a6af69d00abb
16-
github.com/teamwork/twapi-go-sdk v1.20.1
16+
github.com/teamwork/twapi-go-sdk v1.20.2
1717
)
1818

1919
require (
@@ -87,7 +87,7 @@ require (
8787
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
8888
golang.org/x/mod v0.35.0 // indirect
8989
golang.org/x/oauth2 v0.36.0 // indirect
90-
golang.org/x/sys v0.46.0 // indirect
90+
golang.org/x/sys v0.47.0 // indirect
9191
golang.org/x/text v0.37.0 // indirect
9292
golang.org/x/time v0.15.0 // indirect
9393
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ github.com/teamwork/desksdkgo v1.0.1 h1:Mi5D1pnGfL5JwD7s7g7OyHml7Y9jsak5MNJaotJt
184184
github.com/teamwork/desksdkgo v1.0.1/go.mod h1:Mgvw83q8iqHr7Sm9xV1iI/T89o3ObaPU3ChMJheRzwA=
185185
github.com/teamwork/spacessdkgo v0.0.0-20260518181558-a6af69d00abb h1:bQluDjySZeC5etnWgjk4WFRy0PvzGDw8XEBd4JJYWCQ=
186186
github.com/teamwork/spacessdkgo v0.0.0-20260518181558-a6af69d00abb/go.mod h1:jfE0RLsZuk/3Glzs5bJ95pNb92emV7uXZYgoGSLQ76I=
187-
github.com/teamwork/twapi-go-sdk v1.20.1 h1:rnRoumR3F1FfckHyeMv4/zDzqYm1w9QbfR/6GrIov+A=
188-
github.com/teamwork/twapi-go-sdk v1.20.1/go.mod h1:Z0R6uOeso0BH1tKdHVbT5TOqVGPMwPLuTPsHSyl4G/8=
187+
github.com/teamwork/twapi-go-sdk v1.20.2 h1:wO9c28OXtwDXjeAZB8u44OkotKsAaaBVgO8B+9hYfew=
188+
github.com/teamwork/twapi-go-sdk v1.20.2/go.mod h1:uj6BNtyyKtggfeY3whzn8bLWuhP1twhghjWD6z3h3F4=
189189
github.com/tinylib/msgp v1.6.3 h1:bCSxiTz386UTgyT1i0MSCvdbWjVW+8sG3PjkGsZQt4s=
190190
github.com/tinylib/msgp v1.6.3/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
191191
github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA=
@@ -297,8 +297,8 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
297297
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
298298
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
299299
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
300-
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
301-
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
300+
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
301+
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
302302
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
303303
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
304304
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

internal/twprojects/tasklists.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,17 @@ func TasklistList(engine *twapi.Engine) toolsets.ToolWrapper {
306306
},
307307
},
308308
"search_term": helpers.SearchTermSchema("tasklists", "name"),
309-
"page": helpers.PageSchema(),
310-
"page_size": helpers.PageSizeSchema(),
311-
"verbose": helpers.VerboseSchema(),
309+
"show_completed": {
310+
Description: "If true, include completed tasklists; excluded by default.",
311+
AnyOf: []*jsonschema.Schema{
312+
{Type: "boolean"},
313+
{Type: "null"},
314+
},
315+
Default: []byte(`false`),
316+
},
317+
"page": helpers.PageSchema(),
318+
"page_size": helpers.PageSizeSchema(),
319+
"verbose": helpers.VerboseSchema(),
312320
},
313321
Required: []string{},
314322
},
@@ -325,6 +333,7 @@ func TasklistList(engine *twapi.Engine) toolsets.ToolWrapper {
325333
err := helpers.ParamGroup(arguments,
326334
helpers.OptionalNumericParam(&tasklistListRequest.Path.ProjectID, "project_id"),
327335
helpers.OptionalParam(&tasklistListRequest.Filters.SearchTerm, "search_term"),
336+
helpers.OptionalPointerParam(&tasklistListRequest.Filters.ShowCompleted, "show_completed"),
328337
helpers.OptionalNumericParam(&tasklistListRequest.Filters.Page, "page"),
329338
helpers.OptionalNumericParam(&tasklistListRequest.Filters.PageSize, "page_size"),
330339
helpers.OptionalParam(&verbose, "verbose"),

internal/twprojects/tasklists_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ func TestTasklistGet(t *testing.T) {
4646
func TestTasklistList(t *testing.T) {
4747
mcpServer := mcpServerMock(t, http.StatusOK, []byte(`{}`))
4848
testutil.ExecuteToolRequest(t, mcpServer, twprojects.MethodTasklistList.String(), map[string]any{
49-
"search_term": "test",
50-
"page": float64(1),
51-
"page_size": float64(10),
49+
"search_term": "test",
50+
"show_completed": true,
51+
"page": float64(1),
52+
"page_size": float64(10),
5253
})
5354
}
5455

0 commit comments

Comments
 (0)