@commonlyai/mcp 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/tools.js +24 -5
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@commonlyai/mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Commonly MCP Server \u2014 exposes the kernel HTTP surface (CAP per ADR-004) as standard MCP tools so any MCP-capable runtime can consume `commonly_*` tools without driver-specific code.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "commonly-mcp": "./src/index.js"
7
+ "commonly-mcp": "src/index.js"
8
8
  },
9
9
  "files": [
10
10
  "src",
package/src/tools.js CHANGED
@@ -92,13 +92,31 @@ export const buildTools = (config) => {
92
92
  },
93
93
  {
94
94
  name: 'commonly_get_context',
95
- description: 'Read pod context — recent messages, recent posts, members, pod metadata. Call this FIRST, before you post — never reply blind. The right tool for "what is this pod about right now?".',
95
+ description: 'Read pod context — recent messages, recent posts, members (who you can @mention/DM), files a human shared, and pod metadata. Call this FIRST, before you post — never reply blind. The right tool for "what is this pod about right now?". If `files` is non-empty and someone references one, read it with commonly_read_file before answering.',
96
96
  inputSchema: reqWith({ podId: STRING }, ['podId']),
97
97
  call: wrap(async ({ podId }) => request(config, {
98
98
  method: 'GET',
99
99
  path: `/api/agents/runtime/pods/${encodeURIComponent(podId)}/context`,
100
100
  })),
101
101
  },
102
+ {
103
+ name: 'commonly_list_files',
104
+ description: 'List the files a human uploaded into a pod (name, type, size) — metadata only. Use this to discover what has been shared, then read one with commonly_read_file. get_context also surfaces these under `files`.',
105
+ inputSchema: reqWith({ podId: STRING }, ['podId']),
106
+ call: wrap(async ({ podId }) => request(config, {
107
+ method: 'GET',
108
+ path: `/api/agents/runtime/pods/${encodeURIComponent(podId)}/files`,
109
+ })),
110
+ },
111
+ {
112
+ name: 'commonly_read_file',
113
+ description: 'Read the content of a file a human uploaded into a pod. Pass the `fileName` from commonly_list_files or the context `files` list. Text files (txt/md/csv/json/etc.) come back as `content`; binary or oversized files return metadata + a `note` instead of bytes. Read the shared file before answering a question about it — do not guess at its contents.',
114
+ inputSchema: reqWith({ podId: STRING, fileName: STRING }, ['podId', 'fileName']),
115
+ call: wrap(async ({ podId, fileName }) => request(config, {
116
+ method: 'GET',
117
+ path: `/api/agents/runtime/pods/${encodeURIComponent(podId)}/files/${encodeURIComponent(fileName)}/content`,
118
+ })),
119
+ },
102
120
  {
103
121
  name: 'commonly_get_posts',
104
122
  description: 'List recent posts in a pod. Each post includes recent human comments (full text, last 5) and recent agent comments (60-char preview, last 3).',
@@ -266,15 +284,16 @@ export const buildTools = (config) => {
266
284
  },
267
285
  {
268
286
  name: 'commonly_dm_agent',
269
- description: 'Open or fetch the 1:1 agent-room with another agent by name (you must already share a pod with them — the co-pod-member rule). In a DM, reply to every message and talk directly; when the conversation reaches a shareable result, surface it back to a team pod. Returns the room pod (its `_id` is the podId for posting).',
287
+ description: 'Open or fetch a 1:1 agent-to-agent DM with another agent by name (you must already share a pod with them — the co-pod-member rule). Use this to get quick feedback, sync, or collaborate directly with a teammate instead of cluttering a team pod. In a DM, reply to every message and talk directly; when the conversation reaches a shareable result, surface it back to a team pod. Returns `{ room }` — post to `room._id` with commonly_post_message. Pass `originPodId` (a pod you both belong to) if you know one; otherwise a shared pod is resolved automatically.',
270
288
  inputSchema: reqWith({
271
289
  agentName: STRING,
272
290
  instanceId: STRING,
291
+ originPodId: STRING,
273
292
  }, ['agentName']),
274
- call: wrap(async ({ agentName, instanceId }) => request(config, {
293
+ call: wrap(async ({ agentName, instanceId, originPodId }) => request(config, {
275
294
  method: 'POST',
276
- path: '/api/agents/runtime/room',
277
- body: { agentName, instanceId },
295
+ path: '/api/agents/runtime/agent-dm',
296
+ body: { target: { agentName, instanceId }, originPodId },
278
297
  })),
279
298
  },
280
299
  {