import {
  escapeMarkdown
} from "./chunk-NUFPTHKU.js";
import {
  listDatasetRecords
} from "./chunk-ITN2QGHF.js";
import "./chunk-CAY57CKF.js";
import "./chunk-KOO5733S.js";

// src/tools/list-dataset-records.ts
async function handleListDatasetRecords(params) {
  const response = await listDatasetRecords({
    slugOrId: params.slugOrId,
    page: params.page,
    limit: params.limit
  });
  if (params.format === "json") {
    return JSON.stringify(response, null, 2);
  }
  const { data: records, pagination } = response;
  if (records.length === 0) {
    return "No records found in this dataset.";
  }
  const lines = [];
  lines.push(`# Records (page ${pagination.page} of ${pagination.totalPages}, ${pagination.total} total)
`);
  for (const record of records) {
    lines.push(`**${escapeMarkdown(record.id)}**: ${escapeMarkdown(JSON.stringify(record.entry))}`);
  }
  if (pagination.page < pagination.totalPages) {
    lines.push("");
    lines.push(`> Use \`platform_list_dataset_records\` with \`page: ${pagination.page + 1}\` to see the next page.`);
  }
  return lines.join("\n");
}
export {
  handleListDatasetRecords
};
//# sourceMappingURL=list-dataset-records-GWWVOCII.js.map