Skip to content

Commit fb197e1

Browse files
Post reactions and comments
1 parent 2c9cacc commit fb197e1

File tree

3 files changed

+67
-9
lines changed

3 files changed

+67
-9
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "linkedapi-mcp",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "MCP server for Linked API",
55
"main": "dist/index.js",
66
"bin": {
@@ -31,7 +31,7 @@
3131
"license": "MIT",
3232
"dependencies": {
3333
"@modelcontextprotocol/sdk": "^1.17.4",
34-
"linkedapi-node": "^1.2.2",
34+
"linkedapi-node": "^1.2.7",
3535
"zod": "^4.1.1"
3636
},
3737
"devDependencies": {

src/tools/fetch-post.ts

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,27 @@ export class FetchPostTool extends OperationTool<TFetchPostParams, unknown> {
99
public override readonly operationName = OPERATION_NAME.fetchPost;
1010
protected override readonly schema = z.object({
1111
postUrl: z.string(),
12+
retrieveComments: z.boolean().optional(),
13+
retrieveReactions: z.boolean().optional(),
14+
commentsRetrievalConfig: z
15+
.object({
16+
limit: z.number().min(1).max(500).optional(),
17+
replies: z.boolean().optional(),
18+
sort: z.enum(['mostRelevant', 'mostRecent']).optional(),
19+
})
20+
.optional(),
21+
reactionsRetrievalConfig: z
22+
.object({
23+
limit: z.number().min(1).max(1000).optional(),
24+
})
25+
.optional(),
1226
});
1327

1428
public override getTool(): Tool {
1529
return {
1630
name: this.name,
1731
description:
18-
'This action allows you to open a post to retrieve its data. (st.openPost action).',
32+
'Open a LinkedIn post and retrieve its data, with optional comments and reactions. (st.openPost action).',
1933
inputSchema: {
2034
type: 'object',
2135
properties: {
@@ -24,6 +38,50 @@ export class FetchPostTool extends OperationTool<TFetchPostParams, unknown> {
2438
description:
2539
"LinkedIn URL of the post. (e.g., 'https://www.linkedin.com/posts/username_activity-id')",
2640
},
41+
retrieveComments: {
42+
type: 'boolean',
43+
description:
44+
'Optional. When true, also retrieve comments for the post. Configure via commentsRetrievalConfig.',
45+
},
46+
retrieveReactions: {
47+
type: 'boolean',
48+
description:
49+
'Optional. When true, also retrieve reactions for the post. Configure via reactionsRetrievalConfig.',
50+
},
51+
commentsRetrievalConfig: {
52+
type: 'object',
53+
description:
54+
'Optional. Applies only when retrieveComments is true. Controls comments retrieval (limit, replies, sort).',
55+
properties: {
56+
limit: {
57+
type: 'number',
58+
description:
59+
'Optional. Max number of comments to retrieve. Defaults to 10, with a maximum value of 500.',
60+
},
61+
replies: {
62+
type: 'boolean',
63+
description: 'Optional. When true, include replies to comments (threaded).',
64+
},
65+
sort: {
66+
type: 'string',
67+
enum: ['mostRelevant', 'mostRecent'],
68+
description:
69+
"Optional. Sort order for comments. One of 'mostRelevant' or 'mostRecent'.",
70+
},
71+
},
72+
},
73+
reactionsRetrievalConfig: {
74+
type: 'object',
75+
description:
76+
'Optional. Applies only when retrieveReactions is true. Controls reactions retrieval (limit).',
77+
properties: {
78+
limit: {
79+
type: 'number',
80+
description:
81+
'Optional. Max number of reactions to retrieve. Defaults to 10, with a maximum value of 1000.',
82+
},
83+
},
84+
},
2785
},
2886
required: ['postUrl'],
2987
},

0 commit comments

Comments
 (0)