@claudinho/mcp 0.8.6 → 0.8.8

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.
Files changed (2) hide show
  1. package/dist/index.js +40 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3840,6 +3840,22 @@ async function marketFixtureForTeam(adapter, code, now = /* @__PURE__ */ new Dat
3840
3840
  const next = nextFixtureForTeam(code, { from: now });
3841
3841
  return { match: next, degraded: false };
3842
3842
  }
3843
+ async function getNextFixtureForTeam(adapter, code, now = /* @__PURE__ */ new Date()) {
3844
+ const base = allFixtures();
3845
+ let matches = base;
3846
+ let degraded = true;
3847
+ let liveById;
3848
+ try {
3849
+ const live = adapter.fetchWindow ? await adapter.fetchWindow(KNOCKOUT_WINDOW_START, KNOCKOUT_WINDOW_END) : [];
3850
+ matches = mergeLive(base, live);
3851
+ degraded = false;
3852
+ liveById = new Set(live.map((m) => m.id));
3853
+ } catch {
3854
+ }
3855
+ const fixture = nextFixtureForTeam(code, { from: now, fixtures: matches });
3856
+ const source = fixture && liveById?.has(fixture.id) ? adapter.name : void 0;
3857
+ return { fixture, degraded, source };
3858
+ }
3843
3859
  async function getMatchById(adapter, id) {
3844
3860
  const base = allFixtures().find((m) => m.id === id);
3845
3861
  if (!base) return { match: void 0, degraded: false };
@@ -4783,18 +4799,23 @@ async function standingsResourceText(group, adapter) {
4783
4799
  }
4784
4800
  async function toolGetNextFixture(args) {
4785
4801
  const code = args.team.toUpperCase();
4786
- const fixture = nextFixtureForTeam(code, { from: args.now ?? /* @__PURE__ */ new Date() });
4802
+ const { fixture, degraded, source } = await getNextFixtureForTeam(
4803
+ resolveAdapter(args),
4804
+ code,
4805
+ args.now ?? /* @__PURE__ */ new Date()
4806
+ );
4787
4807
  if (!fixture) {
4808
+ const msg = degraded ? `Couldn't reach the data provider \u2014 no upcoming fixture confirmed for ${code}.` : `No upcoming fixture found for ${code}.`;
4788
4809
  return {
4789
- text: withDisclaimer(`No upcoming fixture found for ${code}.`),
4790
- data: { team: code, fixture: null }
4810
+ text: withDisclaimer(msg, void 0, args.lang),
4811
+ data: { team: code, fixture: null, degraded }
4791
4812
  };
4792
4813
  }
4793
4814
  const opts = fmtOpts(args);
4794
4815
  return {
4795
4816
  text: withDisclaimer(`Next up for ${code}:
4796
- ${matchLine(fixture, opts)}`),
4797
- data: { team: code, fixture }
4817
+ ${matchLine(fixture, opts)}`, source, args.lang),
4818
+ data: { team: code, fixture, degraded }
4798
4819
  };
4799
4820
  }
4800
4821
  async function toolGetMarketSignal(args) {
@@ -5012,7 +5033,11 @@ async function toolGetShareSnippet(args) {
5012
5033
  }
5013
5034
  if (args.team) {
5014
5035
  const code = args.team.toUpperCase();
5015
- const fixture = nextFixtureForTeam(code, { from: args.now ?? /* @__PURE__ */ new Date() });
5036
+ const { fixture, degraded: degraded2, source: source2 } = await getNextFixtureForTeam(
5037
+ resolveAdapter(args),
5038
+ code,
5039
+ args.now ?? /* @__PURE__ */ new Date()
5040
+ );
5016
5041
  const matches = fixture ? [fixture] : [];
5017
5042
  const teamName = fixture ? fixture.home.code === code ? fixture.home.name : fixture.away.name : code;
5018
5043
  return shareResult(
@@ -5023,7 +5048,11 @@ async function toolGetShareSnippet(args) {
5023
5048
  title: `Next up for ${teamName}`,
5024
5049
  matches,
5025
5050
  marketSignals: await signalsFor(matches),
5026
- emptyNote: `No upcoming fixture found for ${code}.`,
5051
+ // Attribute the provider only when the overlay resolved the tie; parity
5052
+ // with get_next_fixture (a static group fixture carries no source).
5053
+ source: source2,
5054
+ degraded: degraded2,
5055
+ emptyNote: degraded2 ? `Couldn't reach the data provider \u2014 no upcoming fixture confirmed for ${code}.` : `No upcoming fixture found for ${code}.`,
5027
5056
  installLine: `npx @claudinho/cli next ${code}`,
5028
5057
  tz: args.tz,
5029
5058
  locale: args.lang
@@ -5056,7 +5085,7 @@ async function toolGetShareSnippet(args) {
5056
5085
 
5057
5086
  // src/server.ts
5058
5087
  var SERVER_NAME = "claudinho";
5059
- var SERVER_VERSION = "0.8.6";
5088
+ var SERVER_VERSION = "0.8.8";
5060
5089
  var VOICE = asFlavorLevel(process.env.CLAUDINHO_FLAVOR) === "off" ? "" : `
5061
5090
  Voice: when relaying scores, narrate with lively, regionally-appropriate football-commentary energy in the user's language. Each match line may end with a short exclamation ("\u2014 \xA1GOOOOL!") \u2014 use it as a tone cue. Keep every fact exact; never invent details and never impersonate or name a real commentator.`;
5062
5091
  var INSTRUCTIONS = `Claudinho serves live scores, fixtures, and group standings for the 2026 men's football tournament.
@@ -5150,10 +5179,10 @@ function buildServer() {
5150
5179
  "get_next_fixture",
5151
5180
  {
5152
5181
  title: "Next fixture for a team",
5153
- description: "A team's next scheduled match. Use a 3-letter code, e.g. MEX, BRA, USA. Instant and offline \u2014 answered from the bundled schedule, no network.",
5182
+ description: "A team's next match, live-resolved: a confirmed knockout tie (Round of 32 onward) is read from the live overlay, group fixtures from the bundled schedule. Use a 3-letter code, e.g. MEX, BRA, USA. Falls back to the bundled schedule if the provider is unreachable.",
5154
5183
  inputSchema: { team: teamArg.describe("3-letter team code, e.g. MEX"), ...commonArgs },
5155
- // Read-only and served entirely from the bundled static schedule.
5156
- annotations: { readOnlyHint: true, openWorldHint: false }
5184
+ // Read-only; overlays live provider data for knockout pairings, so open-world.
5185
+ annotations: { readOnlyHint: true, openWorldHint: true }
5157
5186
  },
5158
5187
  async (args) => toContent(await toolGetNextFixture(args))
5159
5188
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudinho/mcp",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "mcpName": "io.github.arturogarrido/claudinho",
5
5
  "description": "MCP server for the 2026 men's football tournament — live scores, fixtures, standings, read-only prediction-market signals, and paste-ready match cards. Works with Claude Code, Cursor, Codex, Windsurf, Zed. Not affiliated with FIFA or Anthropic.",
6
6
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "tsup": "^8.0.0",
58
58
  "typescript": "^5.7.0",
59
59
  "vitest": "^4.1.9",
60
- "@claudinho/core": "0.8.6"
60
+ "@claudinho/core": "0.8.8"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "tsup",