import {
  getAnnotationsByTrace,
  listAnnotations
} from "./chunk-RDUXCCFR.js";
import "./chunk-CAY57CKF.js";
import "./chunk-KOO5733S.js";

// src/tools/list-annotations.ts
async function handleListAnnotations(params) {
  const annotations = params.traceId ? await getAnnotationsByTrace(params.traceId) : await listAnnotations();
  if (!Array.isArray(annotations) || annotations.length === 0) {
    return params.traceId ? `No annotations found for trace "${params.traceId}".

> Tip: Use \`platform_create_annotation\` to annotate a trace.` : "No annotations found in this project.\n\n> Tip: Use `platform_create_annotation` to annotate a trace.";
  }
  const lines = [];
  lines.push(`# Annotations (${annotations.length} total)
`);
  for (const a of annotations) {
    const rating = a.isThumbsUp === true ? "\u{1F44D}" : a.isThumbsUp === false ? "\u{1F44E}" : "\u2014";
    lines.push(`## Annotation ${a.id ?? "\u2014"}`);
    lines.push(`**Trace ID**: ${a.traceId ?? "\u2014"}`);
    lines.push(`**Rating**: ${rating}`);
    if (a.comment) lines.push(`**Comment**: ${a.comment}`);
    if (a.email) lines.push(`**By**: ${a.email}`);
    lines.push("");
  }
  return lines.join("\n");
}
export {
  handleListAnnotations
};
//# sourceMappingURL=list-annotations-6P3IWILH.js.map