@agentvalet/mcp-server 0.3.5 → 0.3.7

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/dist/index.js +107 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51,20 +51,40 @@ const LIST_PLATFORMS_TOOL = {
51
51
  name: "list_platforms",
52
52
  description: "list_platforms: List the platforms and permission scopes this agent has access to.\nInput: None.\nReturns: { platforms: [{ platformId, platformName, scopes, requireApproval }], version: \"<hex>\" }.\nVersion: a deterministic hash that only changes when the platform set or scopes change. Cache the value across calls in the same session — only refresh when you suspect platforms have changed (e.g. user mentions a new connection).\nAuth: Bearer JWT.",
53
53
  inputSchema: { type: "object", properties: {} },
54
+ outputSchema: {
55
+ type: "object",
56
+ properties: {
57
+ platforms: {
58
+ type: "array",
59
+ items: {
60
+ type: "object",
61
+ properties: {
62
+ platformId: { type: "string" },
63
+ platformName: { type: "string" },
64
+ scopes: { type: "array", items: { type: "string" } },
65
+ requireApproval: { type: "boolean" },
66
+ },
67
+ required: ["platformId", "platformName", "scopes"],
68
+ },
69
+ },
70
+ version: { type: "string" },
71
+ },
72
+ required: ["platforms"],
73
+ },
54
74
  };
55
75
  const USE_PLATFORM_TOOL = {
56
76
  name: "use_platform",
57
- description: "use_platform: Call an external platform API (Airtable, GitHub, Slack, etc.) through the AgentValet proxy.\nInput: platform (string), endpoint (string), method (GET|POST|PUT|PATCH|DELETE), scope (string), data (object, optional).\nReturns: upstream API response body. May take up to 50 seconds when the action requires owner approval — the call will block while we wait, then return the approved result transparently. If approval doesn't land in time, returns a `pending_approval` envelope and the action runs asynchronously; the user is notified when it completes.\nAuth: Bearer JWT.",
77
+ description: "use_platform: Call an external platform API (Airtable, GitHub, Slack, Metabase, etc.) through the AgentValet proxy.\nInput: platform (string), endpoint (string), method (GET|POST|PUT|PATCH|DELETE), scope (string), body (object, optional — JSON request body for POST/PUT/PATCH/DELETE).\nReturns: upstream API response body. May take up to 50 seconds when the action requires owner approval — the call will block while we wait, then return the approved result transparently. If approval doesn't land in time, returns a `pending_approval` envelope and the action runs asynchronously; the user is notified when it completes.\nAuth: Bearer JWT.\nNote: legacy clients passing `data` instead of `body` are still accepted for backwards compatibility, but `body` is the canonical name.",
58
78
  inputSchema: {
59
79
  type: "object",
60
80
  properties: {
61
81
  platform: {
62
82
  type: "string",
63
- description: "Platform ID (e.g. airtable, github, slack)",
83
+ description: "Platform ID (e.g. airtable, github, slack, metabase)",
64
84
  },
65
85
  endpoint: {
66
86
  type: "string",
67
- description: "API path on the target platform (e.g. /v0/meta/bases)",
87
+ description: "API path on the target platform (e.g. /v0/meta/bases or /api/dataset)",
68
88
  },
69
89
  method: {
70
90
  type: "string",
@@ -75,9 +95,13 @@ const USE_PLATFORM_TOOL = {
75
95
  type: "string",
76
96
  description: "Permission scope required for this action (e.g. records:read)",
77
97
  },
98
+ body: {
99
+ type: "object",
100
+ description: "JSON request body for POST/PUT/PATCH/DELETE. Optional. Forwarded verbatim to the upstream API.",
101
+ },
78
102
  data: {
79
103
  type: "object",
80
- description: "Optional request body for POST/PUT/PATCH requests",
104
+ description: "Deprecated alias for `body` — prefer `body`. Kept for backwards compatibility.",
81
105
  },
82
106
  },
83
107
  required: ["platform", "endpoint", "method", "scope"],
@@ -112,6 +136,17 @@ const AGENT_REGISTER_TOOL = {
112
136
  },
113
137
  required: ["owner_id", "agent_name", "requested_scopes"],
114
138
  },
139
+ outputSchema: {
140
+ type: "object",
141
+ properties: {
142
+ registration_token: { type: "string" },
143
+ poll_url: { type: "string" },
144
+ client_id: { type: "string" },
145
+ scope: { type: "string" },
146
+ expires_in: { type: "number" },
147
+ },
148
+ required: ["registration_token"],
149
+ },
115
150
  };
116
151
  const AGENT_STATUS_TOOL = {
117
152
  name: "agent_status",
@@ -126,6 +161,15 @@ const AGENT_STATUS_TOOL = {
126
161
  },
127
162
  required: ["token"],
128
163
  },
164
+ outputSchema: {
165
+ type: "object",
166
+ properties: {
167
+ status: { type: "string", enum: ["pending_approval", "approved", "rejected"] },
168
+ agent_id: { type: "string" },
169
+ mcp_config: { type: "object" },
170
+ },
171
+ required: ["status"],
172
+ },
129
173
  };
130
174
  const AUTHZEN_EVALUATE_TOOL = {
131
175
  name: "authzen_evaluate",
@@ -144,6 +188,14 @@ const AUTHZEN_EVALUATE_TOOL = {
144
188
  },
145
189
  required: ["platform_id", "scope"],
146
190
  },
191
+ outputSchema: {
192
+ type: "object",
193
+ properties: {
194
+ decision: { type: "boolean" },
195
+ context: { type: "object", properties: { reason: { type: "string" } } },
196
+ },
197
+ required: ["decision"],
198
+ },
147
199
  };
148
200
  const REPORT_SELF_DIAGNOSTIC_TOOL = {
149
201
  name: "report_self_diagnostic",
@@ -183,11 +235,55 @@ const REPORT_SELF_DIAGNOSTIC_TOOL = {
183
235
  },
184
236
  required: ["severity", "message"],
185
237
  },
238
+ outputSchema: {
239
+ type: "object",
240
+ properties: {
241
+ id: { type: "string" },
242
+ received_at: { type: "string" },
243
+ },
244
+ required: ["id"],
245
+ },
186
246
  };
187
247
  const LIST_MY_PENDING_ACTIONS_TOOL = {
188
248
  name: "list_my_pending_actions",
189
249
  description: "list_my_pending_actions: Returns this agent's currently-pending approval requests AND any that completed in the last 24 hours. Use this at session start when the user mentions an earlier action, or when use_platform's long-poll timed out and the user comes back asking what happened.\nInput: None.\nReturns: { pending: [{approval_id, platform_id, scope, created_at, expires_at}], recently_completed: [{approval_id, platform_id, scope, status, executed_at, result_summary, execution_error}] }.\nAuth: Bearer agent JWT (sent automatically).",
190
250
  inputSchema: { type: "object", properties: {} },
251
+ outputSchema: {
252
+ type: "object",
253
+ properties: {
254
+ pending: {
255
+ type: "array",
256
+ items: {
257
+ type: "object",
258
+ properties: {
259
+ approval_id: { type: "string" },
260
+ platform_id: { type: "string" },
261
+ scope: { type: "string" },
262
+ created_at: { type: "string" },
263
+ expires_at: { type: "string" },
264
+ },
265
+ required: ["approval_id", "platform_id", "scope"],
266
+ },
267
+ },
268
+ recently_completed: {
269
+ type: "array",
270
+ items: {
271
+ type: "object",
272
+ properties: {
273
+ approval_id: { type: "string" },
274
+ platform_id: { type: "string" },
275
+ scope: { type: "string" },
276
+ status: { type: "string" },
277
+ executed_at: { type: "string" },
278
+ result_summary: { type: "string" },
279
+ execution_error: { type: "string" },
280
+ },
281
+ required: ["approval_id", "status"],
282
+ },
283
+ },
284
+ },
285
+ required: ["pending", "recently_completed"],
286
+ },
191
287
  };
192
288
  // TODO: intent_resolve tool — planned for future release
193
289
  // ---------------------------------------------------------------------------
@@ -259,12 +355,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
259
355
  };
260
356
  }
261
357
  const progressToken = request.params._meta?.progressToken;
358
+ // Accept either `body` (canonical) or `data` (legacy alias). `body` wins
359
+ // when both are supplied. This matters because Claude (and other LLM
360
+ // hosts) reach for `body` as the natural HTTP terminology — the prior
361
+ // schema only declared `data` which made every POST get silently
362
+ // dropped to an empty body. See the use_platform tool description.
363
+ const bodyArg = (args.body ?? args.data);
262
364
  return await handleUsePlatform({
263
365
  platform: args.platform,
264
366
  endpoint: args.endpoint,
265
367
  method: args.method,
266
368
  scope: args.scope,
267
- data: args.data,
369
+ data: bodyArg,
268
370
  }, progressToken);
269
371
  }
270
372
  if (name === "agent_register") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvalet/mcp-server",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "AgentValet MCP server — lets AI agents call approved platforms via the AgentValet proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",