@avallon-labs/mcp 59.0.0-staging.1311 → 59.1.0

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.
package/dist/index.js CHANGED
@@ -56,5 +56,5 @@ function describeErrors(body) {
56
56
 
57
57
  // src/index.ts
58
58
  setupFetch();
59
- await import("./server-6PRFOUD5.js");
59
+ await import("./server-NRTUNVHI.js");
60
60
  //# sourceMappingURL=index.js.map
@@ -3583,6 +3583,43 @@ var getToolVersionChangeSummary = async (id, version, options) => {
3583
3583
  const data = body ? JSON.parse(body) : {};
3584
3584
  return { data, status: res.status, headers: res.headers };
3585
3585
  };
3586
+ var getListToolCallsUrl = (params) => {
3587
+ const normalizedParams = new URLSearchParams();
3588
+ Object.entries(params || {}).forEach(([key, value]) => {
3589
+ if (value !== void 0) {
3590
+ normalizedParams.append(key, value === null ? "null" : String(value));
3591
+ }
3592
+ });
3593
+ const stringifiedParams = normalizedParams.toString();
3594
+ return stringifiedParams.length > 0 ? `/v1/tool-calls?${stringifiedParams}` : `/v1/tool-calls`;
3595
+ };
3596
+ var listToolCalls = async (params, options) => {
3597
+ const res = await fetch(
3598
+ getListToolCallsUrl(params),
3599
+ {
3600
+ ...options,
3601
+ method: "GET"
3602
+ }
3603
+ );
3604
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3605
+ const data = body ? JSON.parse(body) : {};
3606
+ return { data, status: res.status, headers: res.headers };
3607
+ };
3608
+ var getGetToolCallUrl = (toolCallId) => {
3609
+ return `/v1/tool-calls/${toolCallId}`;
3610
+ };
3611
+ var getToolCall = async (toolCallId, options) => {
3612
+ const res = await fetch(
3613
+ getGetToolCallUrl(toolCallId),
3614
+ {
3615
+ ...options,
3616
+ method: "GET"
3617
+ }
3618
+ );
3619
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3620
+ const data = body ? JSON.parse(body) : {};
3621
+ return { data, status: res.status, headers: res.headers };
3622
+ };
3586
3623
  var getWorkerListToolsUrl = (params) => {
3587
3624
  const normalizedParams = new URLSearchParams();
3588
3625
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -7994,6 +8031,52 @@ var getToolVersionChangeSummaryHandler = async (args, options) => {
7994
8031
  structuredContent: res.data
7995
8032
  };
7996
8033
  };
8034
+ var listToolCallsHandler = async (args, options) => {
8035
+ const res = await listToolCalls(args.queryParams, options);
8036
+ if (res.status >= 400) {
8037
+ return {
8038
+ content: [
8039
+ {
8040
+ type: "text",
8041
+ text: JSON.stringify(res.data ?? null)
8042
+ }
8043
+ ],
8044
+ isError: true
8045
+ };
8046
+ }
8047
+ return {
8048
+ content: [
8049
+ {
8050
+ type: "text",
8051
+ text: JSON.stringify(res.data ?? null)
8052
+ }
8053
+ ],
8054
+ structuredContent: res.data
8055
+ };
8056
+ };
8057
+ var getToolCallHandler = async (args, options) => {
8058
+ const res = await getToolCall(args.pathParams.toolCallId, options);
8059
+ if (res.status >= 400) {
8060
+ return {
8061
+ content: [
8062
+ {
8063
+ type: "text",
8064
+ text: JSON.stringify(res.data ?? null)
8065
+ }
8066
+ ],
8067
+ isError: true
8068
+ };
8069
+ }
8070
+ return {
8071
+ content: [
8072
+ {
8073
+ type: "text",
8074
+ text: JSON.stringify(res.data ?? null)
8075
+ }
8076
+ ],
8077
+ structuredContent: res.data
8078
+ };
8079
+ };
7997
8080
  var workerListToolsHandler = async (args, options) => {
7998
8081
  const res = await workerListTools(args.queryParams, options);
7999
8082
  if (res.status >= 400) {
@@ -12033,7 +12116,7 @@ var GetProfileResponse = zod.object({
12033
12116
  "last_name": zod.union([zod.string(), zod.null()]),
12034
12117
  "email": zod.string(),
12035
12118
  "role": zod.enum(["admin", "avallon_admin", "member"]),
12036
- "permissions": zod.array(zod.enum(["voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
12119
+ "permissions": zod.array(zod.enum(["voice-agents:write", "voice-agents:promote", "tools:write", "tools:execute", "tools:promote", "tool-calls:read", "extractors:write", "inboxes:write", "inboxes:send", "artifacts:write", "api-keys:write", "teams:write", "cases:write", "cases:delete", "case-types:read", "case-types:create", "case-types:write", "information-requests:write", "information-requests:resolve", "information-requests:delete", "feedback:write", "outbound-jobs:write", "outbound-jobs:schedule", "calls:monitor", "workers:read", "workers:create", "workers:write", "workers:execute", "workers:write-mcp", "workers:run", "workers:promote", "chat-agents:write", "notifications:write", "prompts:read", "prompts:write", "secrets:read", "secrets:write", "schedules:read", "schedules:write", "tenants:write", "analytics:view-cost"])),
12037
12120
  "tenants": zod.object({
12038
12121
  "active": zod.object({
12039
12122
  "id": zod.string(),
@@ -13497,6 +13580,77 @@ var GetToolVersionChangeSummaryResponse = zod.object({
13497
13580
  }),
13498
13581
  "message": zod.string()
13499
13582
  });
13583
+ var listToolCallsQueryCountDefault = 50;
13584
+ var listToolCallsQueryCountMax = 100;
13585
+ var listToolCallsQueryOffsetDefault = 0;
13586
+ var listToolCallsQueryOffsetMin = 0;
13587
+ var listToolCallsQuerySortByDefault = `created_at`;
13588
+ var listToolCallsQuerySortOrderDefault = `desc`;
13589
+ var ListToolCallsQueryParams = zod.object({
13590
+ "tool_id": zod.string().uuid().optional(),
13591
+ "count": zod.number().min(1).max(listToolCallsQueryCountMax).default(listToolCallsQueryCountDefault),
13592
+ "offset": zod.number().min(listToolCallsQueryOffsetMin).default(listToolCallsQueryOffsetDefault),
13593
+ "sort_by": zod.enum(["created_at"]).default(listToolCallsQuerySortByDefault),
13594
+ "sort_order": zod.enum(["asc", "desc"]).default(listToolCallsQuerySortOrderDefault)
13595
+ });
13596
+ var ListToolCallsResponse = zod.object({
13597
+ "data": zod.array(zod.object({
13598
+ "id": zod.string(),
13599
+ "tool_id": zod.string(),
13600
+ "tool_version": zod.number(),
13601
+ "environment": zod.enum(["live", "test"]),
13602
+ "outcome": zod.enum(["success", "failed"]),
13603
+ "created_by": zod.string().describe("Actor that executed the tool"),
13604
+ "created_at": zod.string().datetime({ "offset": true })
13605
+ })),
13606
+ "message": zod.string(),
13607
+ "meta": zod.object({
13608
+ "total": zod.number()
13609
+ })
13610
+ });
13611
+ var GetToolCallParams = zod.object({
13612
+ "toolCallId": zod.string().uuid()
13613
+ });
13614
+ var getToolCallResponseDataDispatchOneAttemptsMin = -9007199254740991;
13615
+ var getToolCallResponseDataDispatchOneAttemptsMax = 9007199254740991;
13616
+ var GetToolCallResponse = zod.object({
13617
+ "data": zod.object({
13618
+ "id": zod.string(),
13619
+ "tool_id": zod.string(),
13620
+ "tool_version": zod.number(),
13621
+ "environment": zod.enum(["live", "test"]),
13622
+ "outcome": zod.enum(["success", "failed"]),
13623
+ "created_by": zod.string().describe("Actor that executed the tool"),
13624
+ "created_at": zod.string().datetime({ "offset": true }),
13625
+ "dispatch": zod.union([zod.object({
13626
+ "id": zod.string(),
13627
+ "trigger": zod.object({
13628
+ "type": zod.enum(["schedule", "email", "information_request", "manual", "call"]),
13629
+ "id": zod.string()
13630
+ }),
13631
+ "target": zod.union([zod.object({
13632
+ "type": zod.enum(["worker_run", "extractor_job", "tool_call"]),
13633
+ "id": zod.string()
13634
+ }), zod.null()]),
13635
+ "due_at": zod.string().datetime({ "offset": true }),
13636
+ "expires_at": zod.string().datetime({ "offset": true }),
13637
+ "environment": zod.enum(["live", "test"]),
13638
+ "status": zod.enum(["pending", "dispatched", "abandoned"]),
13639
+ "attempts": zod.number().int().min(getToolCallResponseDataDispatchOneAttemptsMin).max(getToolCallResponseDataDispatchOneAttemptsMax)
13640
+ }), zod.null()]).describe("The dispatch that executed a scheduled call"),
13641
+ "params": zod.union([zod.record(zod.string(), zod.unknown()), zod.null()]).describe("Null for calls recorded before params were stored"),
13642
+ "result": zod.union([zod.string(), zod.null()]),
13643
+ "error": zod.union([zod.object({
13644
+ "name": zod.string(),
13645
+ "message": zod.string()
13646
+ }), zod.null()]),
13647
+ "traces": zod.union([zod.array(zod.object({
13648
+ "text": zod.string(),
13649
+ "timestamp": zod.string()
13650
+ })), zod.null()])
13651
+ }),
13652
+ "message": zod.string()
13653
+ });
13500
13654
  var workerListToolsQuerySortByDefault = `created_at`;
13501
13655
  var workerListToolsQuerySortOrderDefault = `desc`;
13502
13656
  var WorkerListToolsQueryParams = zod.object({
@@ -16845,6 +16999,38 @@ var createMcpServer = (options) => {
16845
16999
  signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
16846
17000
  })
16847
17001
  );
17002
+ tools.listToolCalls = server2.registerTool(
17003
+ "listToolCalls",
17004
+ {
17005
+ title: "List tool calls",
17006
+ description: "List tool calls without their params, result, error and traces. Requires the `tool-calls:read` permission.",
17007
+ inputSchema: {
17008
+ queryParams: ListToolCallsQueryParams
17009
+ },
17010
+ outputSchema: ListToolCallsResponse,
17011
+ annotations: { readOnlyHint: true }
17012
+ },
17013
+ (args, ctx) => listToolCallsHandler(args, {
17014
+ ...options,
17015
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17016
+ })
17017
+ );
17018
+ tools.getToolCall = server2.registerTool(
17019
+ "getToolCall",
17020
+ {
17021
+ title: "Get tool call",
17022
+ description: "Retrieve a single tool call. Requires the `tool-calls:read` permission.",
17023
+ inputSchema: {
17024
+ pathParams: GetToolCallParams
17025
+ },
17026
+ outputSchema: GetToolCallResponse,
17027
+ annotations: { readOnlyHint: true }
17028
+ },
17029
+ (args, ctx) => getToolCallHandler(args, {
17030
+ ...options,
17031
+ signal: options?.signal ? AbortSignal.any([options.signal, ctx.signal]) : ctx.signal
17032
+ })
17033
+ );
16848
17034
  tools.workerListTools = server2.registerTool(
16849
17035
  "workerListTools",
16850
17036
  {
@@ -17150,4 +17336,4 @@ var transport = new StdioServerTransport();
17150
17336
  server.connect(transport).then(() => {
17151
17337
  console.error("MCP server running on stdio");
17152
17338
  }).catch(console.error);
17153
- //# sourceMappingURL=server-6PRFOUD5.js.map
17339
+ //# sourceMappingURL=server-NRTUNVHI.js.map