@neurynae/toolcairn-mcp 0.10.10 → 0.10.12

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
@@ -675,6 +675,22 @@ var ToolCairnClient = class {
675
675
  async post(path2, body) {
676
676
  try {
677
677
  const res = await this.rawPost(path2, body);
678
+ if (res.status === 429) {
679
+ const exhausted = res.headers.get("x-toolcairn-limit-exhausted") === "1";
680
+ if (exhausted) {
681
+ try {
682
+ const body429 = await res.clone().json();
683
+ const text = body429.message ?? "ToolCairn daily limit reached. Join the Pro waitlist for 1 month free: https://toolcairn.neurynae.com/waitlist?source=limit_exhausted";
684
+ return {
685
+ content: [{ type: "text", text }]
686
+ // isError=false so the agent treats this as a successful tool
687
+ // response and relays the message to the user instead of
688
+ // retrying or bubbling a generic error.
689
+ };
690
+ } catch {
691
+ }
692
+ }
693
+ }
678
694
  const data = await res.json();
679
695
  if (data && typeof data === "object" && "content" in data) {
680
696
  return data;