mistral-debug-bundle

3
0
Source

Collect Mistral AI debug evidence for support tickets and troubleshooting. Use when encountering persistent issues, preparing support tickets, or collecting diagnostic information for Mistral AI problems. Trigger with phrases like "mistral debug", "mistral support bundle", "collect mistral logs", "mistral diagnostic".

Install

mkdir -p .claude/skills/mistral-debug-bundle && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3524" && unzip -o skill.zip -d .claude/skills/mistral-debug-bundle && rm skill.zip

Installs to .claude/skills/mistral-debug-bundle

About this skill

Mistral AI Debug Bundle

Current State

!node --version 2>/dev/null || echo 'N/A' !python3 --version 2>/dev/null || echo 'N/A'

Overview

Collect all necessary diagnostic information for Mistral AI support tickets. Creates a redacted bundle with environment info, SDK versions, API connectivity test, available models, and recent error logs.

Prerequisites

  • Mistral AI SDK installed
  • Access to application logs
  • MISTRAL_API_KEY set (for connectivity test)

Instructions

Step 1: Complete Debug Script

#!/bin/bash
# mistral-debug-bundle.sh — Creates redacted support bundle
set -e

BUNDLE_DIR="mistral-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"

echo "Creating Mistral AI debug bundle..."

# === Environment Info ===
cat > "$BUNDLE_DIR/summary.txt" << EOF
=== Mistral AI Debug Bundle ===
Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)
Hostname: $(hostname)

--- Environment ---
Node.js: $(node --version 2>/dev/null || echo 'not installed')
Python: $(python3 --version 2>/dev/null || echo 'not installed')
npm: $(npm --version 2>/dev/null || echo 'not installed')
OS: $(uname -a)
MISTRAL_API_KEY: ${MISTRAL_API_KEY:+[SET, length=${#MISTRAL_API_KEY}]}${MISTRAL_API_KEY:-[NOT SET]}
EOF

# === SDK Versions ===
echo -e "\n--- SDK Versions ---" >> "$BUNDLE_DIR/summary.txt"
npm list @mistralai/mistralai 2>/dev/null >> "$BUNDLE_DIR/summary.txt" \
  || echo "Node SDK: not installed" >> "$BUNDLE_DIR/summary.txt"
pip show mistralai 2>/dev/null | grep -E "^(Name|Version)" >> "$BUNDLE_DIR/summary.txt" \
  || echo "Python SDK: not installed" >> "$BUNDLE_DIR/summary.txt"

# === API Connectivity ===
echo -e "\n--- API Connectivity ---" >> "$BUNDLE_DIR/summary.txt"
if [ -n "${MISTRAL_API_KEY:-}" ]; then
  HTTP_STATUS=$(curl -s -o "$BUNDLE_DIR/api-response.json" -w "%{http_code}" \
    -H "Authorization: Bearer ${MISTRAL_API_KEY}" \
    https://api.mistral.ai/v1/models 2>/dev/null)
  echo "HTTP Status: $HTTP_STATUS" >> "$BUNDLE_DIR/summary.txt"

  if [ "$HTTP_STATUS" = "200" ]; then
    echo -e "\n--- Available Models ---" >> "$BUNDLE_DIR/summary.txt"
    jq -r '.data[].id' "$BUNDLE_DIR/api-response.json" >> "$BUNDLE_DIR/summary.txt" 2>/dev/null
  fi
  rm -f "$BUNDLE_DIR/api-response.json"
else
  echo "Skipped (no API key)" >> "$BUNDLE_DIR/summary.txt"
fi

# === Dependencies ===
if [ -f "package.json" ]; then
  echo -e "\n--- Dependencies ---" >> "$BUNDLE_DIR/summary.txt"
  jq '{dependencies, devDependencies}' package.json 2>/dev/null >> "$BUNDLE_DIR/summary.txt"
fi

# === Recent Logs (redacted) ===
echo "--- Recent Logs (redacted) ---" > "$BUNDLE_DIR/logs.txt"
if [ -d "logs" ]; then
  grep -i "mistral\|error\|429\|401\|500" logs/*.log 2>/dev/null | tail -100 >> "$BUNDLE_DIR/logs.txt"
fi

# === Config (redacted) ===
if [ -f ".env" ]; then
  sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR/config-redacted.txt"
fi

# === Reproduction Script ===
cat > "$BUNDLE_DIR/reproduce.sh" << 'SCRIPT'
#!/bin/bash
set -euo pipefail
curl -X POST https://api.mistral.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${MISTRAL_API_KEY}" \
  -d '{"model":"mistral-small-latest","messages":[{"role":"user","content":"ping"}]}' 2>&1
echo -e "\nExit code: $?"
SCRIPT
chmod +x "$BUNDLE_DIR/reproduce.sh"

# === Package ===
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "Bundle: $BUNDLE_DIR.tar.gz"
echo "IMPORTANT: Review for sensitive data before sharing!"

Step 2: TypeScript Debug Helper

import { Mistral } from '@mistralai/mistralai';

interface DebugInfo {
  timestamp: string;
  nodeVersion: string;
  apiKeySet: boolean;
  apiKeyLength: number;
  connectivity: 'ok' | 'auth_error' | 'network_error' | 'unknown_error';
  availableModels: string[];
  latencyMs: number;
  lastError?: { message: string; status?: number };
}

async function collectDebugInfo(error?: Error): Promise<DebugInfo> {
  const info: DebugInfo = {
    timestamp: new Date().toISOString(),
    nodeVersion: process.version,
    apiKeySet: !!process.env.MISTRAL_API_KEY,
    apiKeyLength: process.env.MISTRAL_API_KEY?.length ?? 0,
    connectivity: 'unknown_error',
    availableModels: [],
    latencyMs: 0,
  };

  if (error) {
    info.lastError = {
      message: error.message,
      status: (error as any).status,
    };
  }

  if (info.apiKeySet) {
    const start = performance.now();
    try {
      const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });
      const models = await client.models.list();
      info.connectivity = 'ok';
      info.availableModels = models.data?.map(m => m.id) ?? [];
      info.latencyMs = Math.round(performance.now() - start);
    } catch (e: any) {
      info.latencyMs = Math.round(performance.now() - start);
      info.connectivity = e.status === 401 ? 'auth_error' : 'network_error';
    }
  }

  return info;
}

// Usage in catch blocks
try {
  await client.chat.complete({ model: 'mistral-small-latest', messages });
} catch (error) {
  const debug = await collectDebugInfo(error as Error);
  console.error('Debug info:', JSON.stringify(debug, null, 2));
}

Step 3: Request/Response Logger for Debugging

function createDebugClient(): Mistral {
  const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY });

  // Wrap chat.complete to log request/response metadata
  const originalComplete = client.chat.complete.bind(client.chat);
  client.chat.complete = async (params: any) => {
    const start = performance.now();
    console.debug('[MISTRAL REQUEST]', {
      model: params.model,
      messageCount: params.messages?.length,
      hasTools: !!params.tools?.length,
      temperature: params.temperature,
    });

    try {
      const response = await originalComplete(params);
      console.debug('[MISTRAL RESPONSE]', {
        durationMs: Math.round(performance.now() - start),
        finishReason: response.choices?.[0]?.finishReason,
        usage: response.usage,
        hasToolCalls: !!response.choices?.[0]?.message?.toolCalls?.length,
      });
      return response;
    } catch (error: any) {
      console.debug('[MISTRAL ERROR]', {
        durationMs: Math.round(performance.now() - start),
        status: error.status,
        message: error.message,
      });
      throw error;
    }
  };

  return client;
}

Sensitive Data Rules

ALWAYS REDACT: API keys, passwords, PII (emails, names), internal URLs SAFE TO INCLUDE: Error messages, stack traces, SDK versions, HTTP status codes, model IDs

Output

  • mistral-debug-YYYYMMDD-HHMMSS.tar.gz containing:
    • summary.txt — environment, SDK versions, API status
    • logs.txt — recent redacted error logs
    • config-redacted.txt — config with secrets masked
    • reproduce.sh — minimal reproduction script

Error Handling

ItemPurpose
Environment versionsCompatibility check
SDK versionVersion-specific bug identification
API connectivity testNetwork/auth diagnosis
Available modelsKey scope verification
Error logs (redacted)Root cause analysis

Resources

Next Steps

For rate limit issues, see mistral-rate-limits. For common errors, see mistral-common-errors.

svg-icon-generator

jeremylongshore

Svg Icon Generator - Auto-activating skill for Visual Content. Triggers on: svg icon generator, svg icon generator Part of the Visual Content skill category.

6814

d2-diagram-creator

jeremylongshore

D2 Diagram Creator - Auto-activating skill for Visual Content. Triggers on: d2 diagram creator, d2 diagram creator Part of the Visual Content skill category.

2412

performing-penetration-testing

jeremylongshore

This skill enables automated penetration testing of web applications. It uses the penetration-tester plugin to identify vulnerabilities, including OWASP Top 10 threats, and suggests exploitation techniques. Use this skill when the user requests a "penetration test", "pentest", "vulnerability assessment", or asks to "exploit" a web application. It provides comprehensive reporting on identified security flaws.

379

designing-database-schemas

jeremylongshore

Design and visualize efficient database schemas, normalize data, map relationships, and generate ERD diagrams and SQL statements.

978

performing-security-audits

jeremylongshore

This skill allows Claude to conduct comprehensive security audits of code, infrastructure, and configurations. It leverages various tools within the security-pro-pack plugin, including vulnerability scanning, compliance checking, cryptography review, and infrastructure security analysis. Use this skill when a user requests a "security audit," "vulnerability assessment," "compliance review," or any task involving identifying and mitigating security risks. It helps to ensure code and systems adhere to security best practices and compliance standards.

86

django-view-generator

jeremylongshore

Generate django view generator operations. Auto-activating skill for Backend Development. Triggers on: django view generator, django view generator Part of the Backend Development skill category. Use when working with django view generator functionality. Trigger with phrases like "django view generator", "django generator", "django".

15

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.