@agledger/mcp-server 2.0.0 → 2.0.1
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/api-client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/api-client.ts +1 -1
- package/src/index.ts +1 -1
- package/src/server.ts +1 -1
- package/dist/enums.d.ts +0 -110
- package/dist/enums.d.ts.map +0 -1
- package/dist/enums.js +0 -42
- package/dist/enums.js.map +0 -1
- package/dist/errors.d.ts +0 -10
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -49
- package/dist/errors.js.map +0 -1
- package/dist/resources/contract-types.d.ts +0 -4
- package/dist/resources/contract-types.d.ts.map +0 -1
- package/dist/resources/contract-types.js +0 -104
- package/dist/resources/contract-types.js.map +0 -1
- package/dist/tool-scopes.d.ts +0 -11
- package/dist/tool-scopes.d.ts.map +0 -1
- package/dist/tool-scopes.js +0 -164
- package/dist/tool-scopes.js.map +0 -1
- package/dist/tools/a2a.d.ts +0 -8
- package/dist/tools/a2a.d.ts.map +0 -1
- package/dist/tools/a2a.js +0 -360
- package/dist/tools/a2a.js.map +0 -1
- package/dist/tools/agent-mandates.d.ts +0 -4
- package/dist/tools/agent-mandates.d.ts.map +0 -1
- package/dist/tools/agent-mandates.js +0 -222
- package/dist/tools/agent-mandates.js.map +0 -1
- package/dist/tools/agents-refs.d.ts +0 -4
- package/dist/tools/agents-refs.d.ts.map +0 -1
- package/dist/tools/agents-refs.js +0 -196
- package/dist/tools/agents-refs.js.map +0 -1
- package/dist/tools/capabilities.d.ts +0 -4
- package/dist/tools/capabilities.d.ts.map +0 -1
- package/dist/tools/capabilities.js +0 -54
- package/dist/tools/capabilities.js.map +0 -1
- package/dist/tools/code-mode.d.ts +0 -4
- package/dist/tools/code-mode.d.ts.map +0 -1
- package/dist/tools/code-mode.js +0 -389
- package/dist/tools/code-mode.js.map +0 -1
- package/dist/tools/compliance.d.ts +0 -4
- package/dist/tools/compliance.d.ts.map +0 -1
- package/dist/tools/compliance.js +0 -63
- package/dist/tools/compliance.js.map +0 -1
- package/dist/tools/dashboard.d.ts +0 -4
- package/dist/tools/dashboard.d.ts.map +0 -1
- package/dist/tools/dashboard.js +0 -57
- package/dist/tools/dashboard.js.map +0 -1
- package/dist/tools/disputes.d.ts +0 -4
- package/dist/tools/disputes.d.ts.map +0 -1
- package/dist/tools/disputes.js +0 -103
- package/dist/tools/disputes.js.map +0 -1
- package/dist/tools/enterprises.d.ts +0 -4
- package/dist/tools/enterprises.d.ts.map +0 -1
- package/dist/tools/enterprises.js +0 -173
- package/dist/tools/enterprises.js.map +0 -1
- package/dist/tools/events.d.ts +0 -4
- package/dist/tools/events.d.ts.map +0 -1
- package/dist/tools/events.js +0 -28
- package/dist/tools/events.js.map +0 -1
- package/dist/tools/federation-admin.d.ts +0 -4
- package/dist/tools/federation-admin.d.ts.map +0 -1
- package/dist/tools/federation-admin.js +0 -567
- package/dist/tools/federation-admin.js.map +0 -1
- package/dist/tools/federation.d.ts +0 -4
- package/dist/tools/federation.d.ts.map +0 -1
- package/dist/tools/federation.js +0 -505
- package/dist/tools/federation.js.map +0 -1
- package/dist/tools/health.d.ts +0 -4
- package/dist/tools/health.d.ts.map +0 -1
- package/dist/tools/health.js +0 -25
- package/dist/tools/health.js.map +0 -1
- package/dist/tools/mandates.d.ts +0 -4
- package/dist/tools/mandates.d.ts.map +0 -1
- package/dist/tools/mandates.js +0 -227
- package/dist/tools/mandates.js.map +0 -1
- package/dist/tools/openclaw.d.ts +0 -4
- package/dist/tools/openclaw.d.ts.map +0 -1
- package/dist/tools/openclaw.js +0 -110
- package/dist/tools/openclaw.js.map +0 -1
- package/dist/tools/receipts.d.ts +0 -8
- package/dist/tools/receipts.d.ts.map +0 -1
- package/dist/tools/receipts.js +0 -111
- package/dist/tools/receipts.js.map +0 -1
- package/dist/tools/reputation.d.ts +0 -4
- package/dist/tools/reputation.d.ts.map +0 -1
- package/dist/tools/reputation.js +0 -62
- package/dist/tools/reputation.js.map +0 -1
- package/dist/tools/schemas.d.ts +0 -4
- package/dist/tools/schemas.d.ts.map +0 -1
- package/dist/tools/schemas.js +0 -453
- package/dist/tools/schemas.js.map +0 -1
- package/dist/tools/verification-keys.d.ts +0 -4
- package/dist/tools/verification-keys.d.ts.map +0 -1
- package/dist/tools/verification-keys.js +0 -27
- package/dist/tools/verification-keys.js.map +0 -1
- package/dist/tools/verification.d.ts +0 -4
- package/dist/tools/verification.d.ts.map +0 -1
- package/dist/tools/verification.js +0 -50
- package/dist/tools/verification.js.map +0 -1
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { apiErrorResult, toStructuredContent } from '../errors.js';
|
|
3
|
-
import { toolMeta } from '../tool-scopes.js';
|
|
4
|
-
export function registerAgentsRefsTools(mcp, client) {
|
|
5
|
-
mcp.registerTool('get_agent', {
|
|
6
|
-
title: 'Get Agent Profile',
|
|
7
|
-
description: 'Retrieve an agent\'s profile by ID, including identity fields like agentClass, ownerRef, and orgUnit. ' +
|
|
8
|
-
'Use this before update_agent to see current values, or to verify an agent exists before assigning mandates.',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
agentId: z.string().describe('Agent ID to retrieve'),
|
|
11
|
-
},
|
|
12
|
-
annotations: {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
destructiveHint: false,
|
|
15
|
-
idempotentHint: true,
|
|
16
|
-
openWorldHint: true,
|
|
17
|
-
},
|
|
18
|
-
_meta: toolMeta('get_agent'),
|
|
19
|
-
}, async (args) => {
|
|
20
|
-
try {
|
|
21
|
-
const result = await client.agents.get(args.agentId);
|
|
22
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
return apiErrorResult(err);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
mcp.registerTool('update_agent', {
|
|
29
|
-
title: 'Update Agent Profile',
|
|
30
|
-
description: 'Update an agent\'s identity fields (agentClass, ownerRef, orgUnit, description). ' +
|
|
31
|
-
'Only provided fields are changed; omitted fields remain unchanged. ' +
|
|
32
|
-
'Use get_agent first to review current values.',
|
|
33
|
-
inputSchema: {
|
|
34
|
-
agentId: z.string().describe('Agent ID to update'),
|
|
35
|
-
agentClass: z.string().optional().describe('Agent classification (e.g. "data-processor", "orchestrator")'),
|
|
36
|
-
ownerRef: z.string().optional().describe('Owner or team reference'),
|
|
37
|
-
orgUnit: z.string().optional().describe('Organizational unit'),
|
|
38
|
-
description: z.string().optional().describe('Human-readable agent description'),
|
|
39
|
-
},
|
|
40
|
-
annotations: {
|
|
41
|
-
readOnlyHint: false,
|
|
42
|
-
destructiveHint: false,
|
|
43
|
-
idempotentHint: true,
|
|
44
|
-
openWorldHint: true,
|
|
45
|
-
},
|
|
46
|
-
_meta: toolMeta('update_agent'),
|
|
47
|
-
}, async (args) => {
|
|
48
|
-
try {
|
|
49
|
-
const result = await client.agents.update(args.agentId, {
|
|
50
|
-
agentClass: args.agentClass,
|
|
51
|
-
ownerRef: args.ownerRef,
|
|
52
|
-
orgUnit: args.orgUnit,
|
|
53
|
-
description: args.description,
|
|
54
|
-
});
|
|
55
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
return apiErrorResult(err);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
mcp.registerTool('add_agent_references', {
|
|
62
|
-
title: 'Add Agent References',
|
|
63
|
-
description: 'Add external references to an agent, linking it to records in external systems like Jira, Salesforce, or GitHub. ' +
|
|
64
|
-
'References enable reverse lookup via lookup_reference. ' +
|
|
65
|
-
'Use get_agent_references to see existing references before adding.',
|
|
66
|
-
inputSchema: {
|
|
67
|
-
agentId: z.string().describe('Agent ID to add references to'),
|
|
68
|
-
references: z.array(z.object({
|
|
69
|
-
system: z.string().describe('External system name (e.g. "jira", "salesforce", "github")'),
|
|
70
|
-
refType: z.string().describe('Reference type within the system (e.g. "ticket", "case", "issue")'),
|
|
71
|
-
refId: z.string().describe('Identifier in the external system'),
|
|
72
|
-
metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata about the reference'),
|
|
73
|
-
})).describe('References to add'),
|
|
74
|
-
},
|
|
75
|
-
annotations: {
|
|
76
|
-
readOnlyHint: false,
|
|
77
|
-
destructiveHint: false,
|
|
78
|
-
idempotentHint: false,
|
|
79
|
-
openWorldHint: true,
|
|
80
|
-
},
|
|
81
|
-
_meta: toolMeta('add_agent_references'),
|
|
82
|
-
}, async (args) => {
|
|
83
|
-
try {
|
|
84
|
-
const result = await client.agents.addReferences(args.agentId, args.references);
|
|
85
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
86
|
-
}
|
|
87
|
-
catch (err) {
|
|
88
|
-
return apiErrorResult(err);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
mcp.registerTool('get_agent_references', {
|
|
92
|
-
title: 'Get Agent References',
|
|
93
|
-
description: 'Get all external references for an agent. Returns links to external systems like Jira, Salesforce, or GitHub. ' +
|
|
94
|
-
'Use this to audit cross-system linkage or before adding new references.',
|
|
95
|
-
inputSchema: {
|
|
96
|
-
agentId: z.string().describe('Agent ID to get references for'),
|
|
97
|
-
},
|
|
98
|
-
annotations: {
|
|
99
|
-
readOnlyHint: true,
|
|
100
|
-
destructiveHint: false,
|
|
101
|
-
idempotentHint: true,
|
|
102
|
-
openWorldHint: true,
|
|
103
|
-
},
|
|
104
|
-
_meta: toolMeta('get_agent_references'),
|
|
105
|
-
}, async (args) => {
|
|
106
|
-
try {
|
|
107
|
-
const result = await client.agents.getReferences(args.agentId);
|
|
108
|
-
const structured = Array.isArray(result) ? { references: result } : result;
|
|
109
|
-
return { content: [], structuredContent: toStructuredContent(structured) };
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
return apiErrorResult(err);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
mcp.registerTool('lookup_reference', {
|
|
116
|
-
title: 'Lookup by External Reference',
|
|
117
|
-
description: 'Reverse lookup an AGLedger entity by its external reference. ' +
|
|
118
|
-
'Use this to find mandates by Jira ticket IDs, Salesforce case numbers, GitHub issue URLs, or any other external system identifier. ' +
|
|
119
|
-
'Returns the AGLedger entity type and ID that matches the reference.',
|
|
120
|
-
inputSchema: {
|
|
121
|
-
system: z.string().describe('External system name (e.g. "jira", "salesforce", "github")'),
|
|
122
|
-
refType: z.string().describe('Reference type within the system (e.g. "ticket", "case", "issue")'),
|
|
123
|
-
refId: z.string().describe('Identifier in the external system'),
|
|
124
|
-
},
|
|
125
|
-
annotations: {
|
|
126
|
-
readOnlyHint: true,
|
|
127
|
-
destructiveHint: false,
|
|
128
|
-
idempotentHint: true,
|
|
129
|
-
openWorldHint: true,
|
|
130
|
-
},
|
|
131
|
-
_meta: toolMeta('lookup_reference'),
|
|
132
|
-
}, async (args) => {
|
|
133
|
-
try {
|
|
134
|
-
const result = await client.references.lookup(args);
|
|
135
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
136
|
-
}
|
|
137
|
-
catch (err) {
|
|
138
|
-
return apiErrorResult(err);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
mcp.registerTool('add_mandate_references', {
|
|
142
|
-
title: 'Add Mandate References',
|
|
143
|
-
description: 'Add external references to a mandate, linking it to records in external systems. ' +
|
|
144
|
-
'For example, link a mandate to a Jira ticket, Salesforce opportunity, or GitHub PR. ' +
|
|
145
|
-
'References enable reverse lookup via lookup_reference and cross-system traceability.',
|
|
146
|
-
inputSchema: {
|
|
147
|
-
mandateId: z.string().describe('Mandate ID to add references to'),
|
|
148
|
-
references: z.array(z.object({
|
|
149
|
-
system: z.string().describe('External system name (e.g. "jira", "salesforce", "github")'),
|
|
150
|
-
refType: z.string().describe('Reference type within the system (e.g. "ticket", "case", "pr")'),
|
|
151
|
-
refId: z.string().describe('Identifier in the external system'),
|
|
152
|
-
metadata: z.record(z.string(), z.unknown()).optional().describe('Additional metadata about the reference'),
|
|
153
|
-
})).describe('References to add'),
|
|
154
|
-
},
|
|
155
|
-
annotations: {
|
|
156
|
-
readOnlyHint: false,
|
|
157
|
-
destructiveHint: false,
|
|
158
|
-
idempotentHint: false,
|
|
159
|
-
openWorldHint: true,
|
|
160
|
-
},
|
|
161
|
-
_meta: toolMeta('add_mandate_references'),
|
|
162
|
-
}, async (args) => {
|
|
163
|
-
try {
|
|
164
|
-
const result = await client.references.addMandateReferences(args.mandateId, args.references);
|
|
165
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
166
|
-
}
|
|
167
|
-
catch (err) {
|
|
168
|
-
return apiErrorResult(err);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
mcp.registerTool('get_mandate_references', {
|
|
172
|
-
title: 'Get Mandate References',
|
|
173
|
-
description: 'Get all external references for a mandate. Returns links to external systems like Jira, Salesforce, or GitHub. ' +
|
|
174
|
-
'Use this for cross-system traceability or to verify linkage before adding new references.',
|
|
175
|
-
inputSchema: {
|
|
176
|
-
mandateId: z.string().describe('Mandate ID to get references for'),
|
|
177
|
-
},
|
|
178
|
-
annotations: {
|
|
179
|
-
readOnlyHint: true,
|
|
180
|
-
destructiveHint: false,
|
|
181
|
-
idempotentHint: true,
|
|
182
|
-
openWorldHint: true,
|
|
183
|
-
},
|
|
184
|
-
_meta: toolMeta('get_mandate_references'),
|
|
185
|
-
}, async (args) => {
|
|
186
|
-
try {
|
|
187
|
-
const result = await client.references.getMandateReferences(args.mandateId);
|
|
188
|
-
const structured = Array.isArray(result) ? { references: result } : result;
|
|
189
|
-
return { content: [], structuredContent: toStructuredContent(structured) };
|
|
190
|
-
}
|
|
191
|
-
catch (err) {
|
|
192
|
-
return apiErrorResult(err);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
//# sourceMappingURL=agents-refs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"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AAU,CAAC,EAAE,CAAC;QAC7E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/tools/capabilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAKpD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAuDpF"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { apiErrorResult, toStructuredContent } from '../errors.js';
|
|
3
|
-
import { toolMeta } from '../tool-scopes.js';
|
|
4
|
-
import { ContractTypeEnum } from '../enums.js';
|
|
5
|
-
export function registerCapabilityTools(mcp, client) {
|
|
6
|
-
mcp.registerTool('get_agent_capabilities', {
|
|
7
|
-
title: 'Get Agent Capabilities',
|
|
8
|
-
description: 'Get the declared contract type capabilities for an agent.',
|
|
9
|
-
inputSchema: {
|
|
10
|
-
agentId: z.string().describe('Agent ID to check capabilities for'),
|
|
11
|
-
},
|
|
12
|
-
annotations: {
|
|
13
|
-
readOnlyHint: true,
|
|
14
|
-
destructiveHint: false,
|
|
15
|
-
idempotentHint: true,
|
|
16
|
-
openWorldHint: true,
|
|
17
|
-
},
|
|
18
|
-
_meta: toolMeta('get_agent_capabilities'),
|
|
19
|
-
}, async (args) => {
|
|
20
|
-
try {
|
|
21
|
-
const result = await client.capabilities.get(args.agentId);
|
|
22
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
return apiErrorResult(err);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
mcp.registerTool('declare_capabilities', {
|
|
29
|
-
title: 'Declare Capabilities',
|
|
30
|
-
description: 'Declare the contract types this agent supports.',
|
|
31
|
-
inputSchema: {
|
|
32
|
-
agentId: z.string().describe('Agent ID to set capabilities for'),
|
|
33
|
-
contractTypes: z.array(ContractTypeEnum).describe('Contract types this agent supports'),
|
|
34
|
-
},
|
|
35
|
-
annotations: {
|
|
36
|
-
readOnlyHint: false,
|
|
37
|
-
destructiveHint: false,
|
|
38
|
-
idempotentHint: true,
|
|
39
|
-
openWorldHint: true,
|
|
40
|
-
},
|
|
41
|
-
_meta: toolMeta('declare_capabilities'),
|
|
42
|
-
}, async (args) => {
|
|
43
|
-
try {
|
|
44
|
-
const result = await client.capabilities.set(args.agentId, {
|
|
45
|
-
contractTypes: args.contractTypes,
|
|
46
|
-
});
|
|
47
|
-
return { content: [], structuredContent: toStructuredContent(result) };
|
|
48
|
-
}
|
|
49
|
-
catch (err) {
|
|
50
|
-
return apiErrorResult(err);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/tools/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,UAAU,uBAAuB,CAAC,GAAc,EAAE,MAAsB;IAC5E,GAAG,CAAC,YAAY,CACd,wBAAwB,EACxB;QACE,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,2DAA2D;QACxE,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,CAAC,MAAM,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