MCPcopy Create free account
hub / github.com/apache/maka / buildTaskGetTool

Function buildTaskGetTool

packages/runtime/src/task-ledger-tools.ts:282–304  ·  view source on GitHub ↗
(store: TaskLedgerStore)

Source from the content-addressed store, hash-verified

280}
281
282function buildTaskGetTool(store: TaskLedgerStore): MakaTool<{ id: string }, string> {
283 return {
284 name: TASK_GET_TOOL_NAME,
285 displayName: 'Task Get',
286 description: 'Get one task from the current session task ledger by id.',
287 parameters: z.object({
288 id: z
289 .string()
290 .min(1)
291 .max(TASK_ID_MAX_CHARS)
292 .refine(
293 isSafeTaskId,
294 'Task reference must be a UUID or short key from the current ledger.',
295 ),
296 }),
297 impl: async (input, ctx) => {
298 const task = await store.get(ctx.sessionId, input.id);
299 if (task?.resumeTrust === 'untrusted') return `No such task: ${input.id}`;
300 if (!task) return `No such task: ${input.id}`;
301 return renderSafeTaskLedgerText([task]);
302 },
303 };
304}

Callers 1

buildTaskLedgerToolsFunction · 0.85

Calls 2

renderSafeTaskLedgerTextFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected