mcpengine/servers/wrike/src/tools/spaces-tools.ts
Jake Shore fdfbc4017e Wrike MCP: Complete rebuild with 60+ tools and 22 React apps
- API Client: Full Wrike API v4 with OAuth2/token auth, pagination, error handling
- 60+ Tools across 14 categories: tasks, folders, projects, spaces, contacts, comments, timelogs, attachments, workflows, custom-fields, approvals, groups, invitations, webhooks
- 22 React Apps: task-dashboard, task-detail, task-grid, task-board, project-dashboard, project-detail, project-grid, folder-tree, space-overview, gantt-view, time-dashboard, time-entries, member-workload, comment-thread, approval-manager, workflow-editor, custom-fields-manager, attachment-gallery, search-results, activity-feed, sprint-board, reports-dashboard
- All apps: dark theme, client-side state, standalone directories
- Full TypeScript types for all Wrike API entities
- Comprehensive README with setup instructions

Replaces single-file stub with production-ready MCP server
2026-02-12 17:18:32 -05:00

120 lines
3.1 KiB
TypeScript

// Wrike Spaces Tools
import { WrikeClient } from '../clients/wrike.js';
export function registerSpacesTools(client: WrikeClient) {
return [
{
name: 'wrike_list_spaces',
description: 'List all accessible spaces',
inputSchema: {
type: 'object',
properties: {},
},
handler: async () => {
const spaces = await client.listSpaces();
return { spaces, count: spaces.length };
},
},
{
name: 'wrike_get_space',
description: 'Get details of a specific space',
inputSchema: {
type: 'object',
properties: {
spaceId: {
type: 'string',
description: 'Space ID',
},
},
required: ['spaceId'],
},
handler: async (args: any) => {
const space = await client.getSpace(args.spaceId);
return { space };
},
},
{
name: 'wrike_create_space',
description: 'Create a new space',
inputSchema: {
type: 'object',
properties: {
title: {
type: 'string',
description: 'Space title',
},
accessType: {
type: 'string',
description: 'Space access type',
enum: ['Personal', 'Private', 'Public'],
},
defaultProjectWorkflowId: {
type: 'string',
description: 'Default project workflow ID',
},
defaultTaskWorkflowId: {
type: 'string',
description: 'Default task workflow ID',
},
},
required: ['title'],
},
handler: async (args: any) => {
const space = await client.createSpace(args);
return { space, message: 'Space created successfully' };
},
},
{
name: 'wrike_update_space',
description: 'Update an existing space',
inputSchema: {
type: 'object',
properties: {
spaceId: {
type: 'string',
description: 'Space ID',
},
title: {
type: 'string',
description: 'New space title',
},
accessType: {
type: 'string',
description: 'New access type',
enum: ['Personal', 'Private', 'Public'],
},
archived: {
type: 'boolean',
description: 'Archive status',
},
},
required: ['spaceId'],
},
handler: async (args: any) => {
const { spaceId, ...updateData } = args;
const space = await client.updateSpace(spaceId, updateData);
return { space, message: 'Space updated successfully' };
},
},
{
name: 'wrike_delete_space',
description: 'Delete a space',
inputSchema: {
type: 'object',
properties: {
spaceId: {
type: 'string',
description: 'Space ID',
},
},
required: ['spaceId'],
},
handler: async (args: any) => {
await client.deleteSpace(args.spaceId);
return { message: 'Space deleted successfully', spaceId: args.spaceId };
},
},
];
}