MCPcopy Create free account
hub / github.com/buct2012dbl/Dorchestrator / execute

Function execute

coding-agent/src/tools/shared-context-tools.ts:25–54  ·  view source on GitHub ↗
(
    args: { key: string; value: string; ttl?: number },
    context: ToolContext
  )

Source from the content-addressed store, hash-verified

23 required: ['key', 'value']
24 },
25 async execute(
26 args: { key: string; value: string; ttl?: number },
27 context: ToolContext
28 ): Promise<ToolResult> {
29 try {
30 // Try to parse as JSON
31 let parsedValue: any;
32 try {
33 parsedValue = JSON.parse(args.value);
34 } catch {
35 parsedValue = args.value;
36 }
37
38 const id = sharedContext.set(args.key, parsedValue, context.agentId, args.ttl);
39
40 return {
41 success: true,
42 data: {
43 id,
44 key: args.key,
45 stored: true
46 }
47 };
48 } catch (error) {
49 return {
50 success: false,
51 error: error instanceof Error ? error.message : String(error)
52 };
53 }
54 }
55};
56
57export const getSharedContextTool: Tool = {

Callers

nothing calls this directly

Calls 5

entriesMethod · 0.80
setMethod · 0.45
getMethod · 0.45
searchMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected