---
title: 'Debug a failed Laravel job with LaraBench MCP'
description: 'Use LaraBench MCP tools to inspect relevant logs and History, review one dry-run check, then retry the failed job yourself.'
canonical_url: 'https://larabench.com/laravel-tinker-workflows/debug-laravel-job-with-mcp'
md_url: 'https://larabench.com/laravel-tinker-workflows/debug-laravel-job-with-mcp.md'
last_updated: '2026-07-28'
---
# Debug a failed Laravel job with LaraBench MCP

> Use LaraBench MCP tools to inspect relevant logs and History, review one dry-run check, then retry the failed job yourself.

## Direct Answer

Set the LaraBench connection to Read only. Ask the agent to inspect relevant entries with `read_logs` and prior runs with `get_run_history`. Inspect any proposed `run_snippet` call before granting Dry run, then retry the failed job yourself after confirming the cause.

## When To Use This

Use this when a queue failure has useful context split between the exception log, runtime configuration, and a previous diagnostic run.

## Terminal Approach

```bash
php artisan queue:failed
tail -n 200 storage/logs/laravel.log
```

## LaraBench Approach

Call `list_connections`, read only the relevant log entries, compare recent History, and review a narrow runtime check. Reading connections, logs, and history is free; MCP run and save actions require Premium.

## Diagnostic Snippet

```php
return [
    'environment' => app()->environment(),
    'queue_connection' => config('queue.default'),
    'job_service' => get_class(app(App\Services\JobService::class)),
];
```

## Expected Result

A useful response names the relevant log entry, a matching History run, the likely cause, and the exact read-only check. MCP runs appear in History with an AI badge.

## Troubleshooting

- If a connection is missing, check its AI access level. Production starts hidden.
- If remote logs cannot be read, keep LaraBench open for the SSH or Docker connection.
- If `run_snippet` is unavailable, confirm Premium access and keep the app open.

## Safety Notes

Start with Read only. Use Dry run only when code execution is necessary. Dry run cannot prevent every external side effect, so avoid mail, API, event, and queue operations.

## Related Sources

- [Laravel failed job documentation](https://laravel.com/docs/13.x/queues#dealing-with-failed-jobs)
- [Laravel logging documentation](https://laravel.com/docs/13.x/logging)
- [LaraBench MCP Server docs](https://larabench.com/docs/advanced-usage/mcp-server)

## Related Workflows

- [Read Laravel logs over SSH](https://larabench.com/laravel-tinker-workflows/read-laravel-logs-over-ssh)
- [Retry one failed Laravel job](https://larabench.com/laravel-tinker-workflows/retry-failed-laravel-jobs)

## Canonical Page

- [HTML page](https://larabench.com/laravel-tinker-workflows/debug-laravel-job-with-mcp)
- [Markdown mirror](https://larabench.com/laravel-tinker-workflows/debug-laravel-job-with-mcp.md)

## Glossary

- [Laravel workflow glossary](https://larabench.com/docs/reference/glossary)

## Sitemap

See the full [sitemap](https://larabench.com/sitemap.md) for all public pages.
