@kajidog/connpass-mcp-server 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3400,10 +3400,17 @@ function compactDateLabel(isoString) {
3400
3400
  function summarizeEventLine(event) {
3401
3401
  const date = compactDateLabel(event.schedule.start);
3402
3402
  const place = event.location?.place || event.location?.address;
3403
+ const { accepted, waiting, limit } = event.participants;
3404
+ const capacityParts = [`${accepted}\u4EBA\u53C2\u52A0`];
3405
+ if (waiting > 0) capacityParts.push(`\u5F85\u3061${waiting}`);
3406
+ if (typeof limit === "number") capacityParts.push(`\u5B9A\u54E1${limit}`);
3407
+ const capacity = capacityParts.join("/");
3403
3408
  const fragments = [
3409
+ `[id:${event.id}]`,
3404
3410
  date,
3405
3411
  event.title,
3406
- place ? `@ ${place}` : void 0
3412
+ place ? `@ ${place}` : void 0,
3413
+ `(${capacity})`
3407
3414
  ].filter(Boolean);
3408
3415
  return `- ${fragments.join(" ")}`;
3409
3416
  }
@@ -3565,14 +3572,22 @@ function formatEventsResponse(response, options) {
3565
3572
  events: response.events.map((event) => formatEvent(event, options))
3566
3573
  };
3567
3574
  }
3568
- function summarizeEventsResponse(response, label = "events") {
3575
+ function summarizeEventBlock(event) {
3576
+ const headline = summarizeEventLine(event);
3577
+ const extras = [];
3578
+ if (event.catchPhrase) extras.push(` ${event.catchPhrase}`);
3579
+ if (event.group?.title) extras.push(` group: ${event.group.title}`);
3580
+ if (extras.length === 0) return headline;
3581
+ return [headline, ...extras].join("\n");
3582
+ }
3583
+ function summarizeEventsResponse(response, label = "events", options) {
3569
3584
  const lines = [
3570
- `${label}: ${response.returned} returned / ${response.available} available`,
3571
- ...response.events.slice(0, 5).map(summarizeEventLine)
3585
+ `${label}: ${response.returned} returned / ${response.available} available`
3572
3586
  ];
3573
- if (response.events.length > 5) {
3574
- lines.push(`- ...and ${response.events.length - 5} more`);
3587
+ if (options?.searchSessionId) {
3588
+ lines.push(`searchSessionId: ${options.searchSessionId}`);
3575
3589
  }
3590
+ lines.push(...response.events.map(summarizeEventBlock));
3576
3591
  return lines.join("\n");
3577
3592
  }
3578
3593
  function summarizeGroupsResponse(response) {
@@ -3828,7 +3843,9 @@ function registerEventTools(deps) {
3828
3843
  content: [
3829
3844
  {
3830
3845
  type: "text",
3831
- text: summarizeEventsResponse(formatted)
3846
+ text: summarizeEventsResponse(formatted, "events", {
3847
+ searchSessionId
3848
+ })
3832
3849
  }
3833
3850
  ],
3834
3851
  structuredContent: {
@@ -3879,7 +3896,10 @@ function registerEventTools(deps) {
3879
3896
  }
3880
3897
  return {
3881
3898
  content: [
3882
- { type: "text", text: summarizeEventsResponse(formatted) }
3899
+ {
3900
+ type: "text",
3901
+ text: `Displayed ${formatted.events.length} of ${formatted.available} events in the browser UI.`
3902
+ }
3883
3903
  ],
3884
3904
  structuredContent: {
3885
3905
  kind: "events",