(args: z.infer<typeof GetArgs>, ctx: ToolContext)
| 128 | description = 'Read the content of an artifact version (defaults to the current version).'; |
| 129 | argsSchema = GetArgs; |
| 130 | isReadOnly = true; |
| 131 | isDestructive = false; |
| 132 | |
| 133 | async execute(args: z.infer<typeof GetArgs>, ctx: ToolContext): Promise<ToolResult> { |
| 134 | try { |
| 135 | const { manifest, version, content } = await getArtifact(ctx.cwd, resolveArtifactId(args), args.version); |
| 136 | return { |
| 137 | content: `Artifact "${manifest.id}" v${version} (${manifest.type}):\n\n${content}`, |
| 138 | metadata: { artifactId: manifest.id, version, type: manifest.type }, |
| 139 | }; |
| 140 | } catch (e: any) { |
| 141 | return { content: e?.message ?? String(e), isError: true }; |
| 142 | } |
| 143 | } |
nothing calls this directly
no test coverage detected