diff --git a/package-lock.json b/package-lock.json index b8d019e..aed0d80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.1.3", "license": "MIT", "dependencies": { - "@linkedapi/node": "^2.1.1", + "@linkedapi/node": "^2.1.3", "@modelcontextprotocol/sdk": "^1.17.4", "zod": "^4.1.1" }, @@ -921,9 +921,9 @@ } }, "node_modules/@linkedapi/node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@linkedapi/node/-/node-2.1.1.tgz", - "integrity": "sha512-5CUuzuWOUvlJ9bBM+M0tua+ezA7mDjUbur87w5h3bqLE5rnHiFT3abspy6HmYxwpXjHErzUs7EfXTJrgejanLQ==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@linkedapi/node/-/node-2.1.3.tgz", + "integrity": "sha512-NeGZwr9QGnt4sqlJyCCpGUmx+9YOB9WyxuFmXpgj/W+aII73u7iYwuxaDwh4YUi4YjAlth4aqOCVWfprZx8clQ==" }, "node_modules/@modelcontextprotocol/sdk": { "version": "1.26.0", diff --git a/package.json b/package.json index 1cd6b1c..9932a1e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "author": "Linked API", "license": "MIT", "dependencies": { - "@linkedapi/node": "^2.1.1", + "@linkedapi/node": "^2.1.3", "@modelcontextprotocol/sdk": "^1.17.4", "zod": "^4.1.1" }, diff --git a/src/linked-api-tools.ts b/src/linked-api-tools.ts index ef4d5df..bcb6570 100644 --- a/src/linked-api-tools.ts +++ b/src/linked-api-tools.ts @@ -30,9 +30,11 @@ import { GetApiUsageTool } from './tools/get-api-usage-stats.js'; import { GetConversationTool } from './tools/get-conversation.js'; import { GetInboxTool } from './tools/get-inbox.js'; import { GetWorkflowResultTool } from './tools/get-workflow-result.js'; +import { ManageConversationTool } from './tools/manage-conversation.js'; import { NvFetchCompanyTool } from './tools/nv-fetch-company.js'; import { NvFetchPersonTool } from './tools/nv-fetch-person.js'; import { NvGetConversationTool } from './tools/nv-get-conversation.js'; +import { NvManageConversationTool } from './tools/nv-manage-conversation.js'; import { NvSearchCompaniesTool } from './tools/nv-search-companies.js'; import { NvSearchPeopleTool } from './tools/nv-search-people.js'; import { NvSendMessageTool } from './tools/nv-send-message.js'; @@ -75,6 +77,7 @@ export class LinkedApiTools { new GetConversationTool(), new SyncInboxTool(), new GetInboxTool(), + new ManageConversationTool(), new CheckConnectionStatusTool(), new RetrieveConnectionsTool(), new SendConnectionRequestTool(), @@ -97,6 +100,7 @@ export class LinkedApiTools { new NvSendMessageTool(), new NvGetConversationTool(), new NvSyncInboxTool(), + new NvManageConversationTool(), new NvSearchCompaniesTool(), new NvSearchPeopleTool(), new NvFetchCompanyTool(), diff --git a/src/tools/manage-conversation.ts b/src/tools/manage-conversation.ts new file mode 100644 index 0000000..12a61ba --- /dev/null +++ b/src/tools/manage-conversation.ts @@ -0,0 +1,37 @@ +import { OPERATION_NAME, TManageConversationParams } from '@linkedapi/node'; +import { Tool } from '@modelcontextprotocol/sdk/types.js'; +import { z } from 'zod'; + +import { OperationTool } from '../utils/linked-api-tool.js'; + +export class ManageConversationTool extends OperationTool { + public override readonly name = 'manage_conversation'; + public override readonly operationName = OPERATION_NAME.manageConversation; + protected override readonly schema = z.object({ + threadId: z.string(), + operation: z.enum(['archive', 'unarchive', 'star', 'unstar', 'mute', 'unmute']), + }); + + public override getTool(): Tool { + return { + name: this.name, + description: + 'Archive, star, or mute a conversation thread by threadId (st.manageConversation action). Provide the threadId as returned by get_inbox and the operation to perform.', + inputSchema: { + type: 'object', + properties: { + threadId: { + type: 'string', + description: 'Conversation thread identifier, as returned by get_inbox.', + }, + operation: { + type: 'string', + description: 'Operation to perform on the conversation thread.', + enum: ['archive', 'unarchive', 'star', 'unstar', 'mute', 'unmute'], + }, + }, + required: ['threadId', 'operation'], + }, + }; + } +} diff --git a/src/tools/nv-manage-conversation.ts b/src/tools/nv-manage-conversation.ts new file mode 100644 index 0000000..794f9f2 --- /dev/null +++ b/src/tools/nv-manage-conversation.ts @@ -0,0 +1,37 @@ +import { OPERATION_NAME, TNvManageConversationParams } from '@linkedapi/node'; +import { Tool } from '@modelcontextprotocol/sdk/types.js'; +import { z } from 'zod'; + +import { OperationTool } from '../utils/linked-api-tool.js'; + +export class NvManageConversationTool extends OperationTool { + public override readonly name = 'nv_manage_conversation'; + public override readonly operationName = OPERATION_NAME.nvManageConversation; + protected override readonly schema = z.object({ + threadId: z.string(), + operation: z.enum(['archive', 'unarchive']), + }); + + public override getTool(): Tool { + return { + name: this.name, + description: + 'Archive or unarchive a Sales Navigator conversation thread by threadId (nv.manageConversation action). Provide the threadId as returned by get_inbox and the operation to perform.', + inputSchema: { + type: 'object', + properties: { + threadId: { + type: 'string', + description: 'Conversation thread identifier, as returned by get_inbox.', + }, + operation: { + type: 'string', + description: 'Operation to perform on the Sales Navigator conversation thread.', + enum: ['archive', 'unarchive'], + }, + }, + required: ['threadId', 'operation'], + }, + }; + } +}