Graceful Tool Failure logo

Graceful Tool Failure

OrganizationPopular
HKUDS
graceful-tool-failure

Report tool failures transparently and attempt minimal viable output with disclaimers

Overview

PublisherHKUDS
RepositoryOpenSpace
Skill namegraceful-tool-failure
Stars
7.7K
Forks
918
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Graceful Tool Failure AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/OpenSpace.git /tmp/OpenSpace
mkdir -p .claude/skills
cp -r /tmp/OpenSpace/benchmarks/gdpval/skills/graceful-tool-failure .claude/skills/graceful-tool-failure
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Graceful Tool Failure in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Graceful Tool Failure on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Graceful Tool Failure is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Graceful Tool Failure Workflow

This skill guides agents on how to respond when critical tools (like PDF extraction, web search, data APIs) fail repeatedly and block task completion.

When to Apply This Skill

Use this pattern when:

  • A core tool required for task completion has failed multiple times (3+ attempts with different approaches)
  • Alternative approaches to achieve the same goal have also failed
  • The task cannot be fully completed without the blocked capability

Step-by-Step Instructions

1. Explicitly Report Blocking Issues

Clearly document what failed and why:

markdown
## Blocking Issues

The following tools/approaches were attempted but failed:

1. **PDF Extraction (pdftotext)**: Command returned error - file appears corrupted or uses non-standard encoding
2. **PDF Extraction (PyMuPDF)**: Library could not parse document structure
3. **Web Search**: Search queries returned no relevant results for [specific topic]

These failures prevent completion of [specific deliverable].

2. Attempt Minimal Viable Output

Using available domain knowledge, create the best possible output with clear limitations:

markdown
## Partial Output (Based on Domain Knowledge)

*Note: The following content is derived from general domain knowledge rather than the requested source materials.*

[Insert best-effort content here]

**Confidence Level**: Low - content has not been verified against source documents
**Recommendation**: Verify all claims against original source materials when available

3. Avoid Claiming Success

Never state the task is complete when core deliverables are missing or unverified:

Incorrect:

"Task completed successfully."

Correct:

"Task partially completed. Core deliverable [X] could not be produced due to tool failures. Minimal viable output provided with disclaimers. Manual review or alternative data sources recommended."

4. Provide Actionable Next Steps

Suggest concrete actions for human operators or alternative approaches:

markdown
## Recommended Next Steps

1. Obtain the source document in an alternative format (e.g., request text version from document owner)
2. Manually extract key information from the PDF and provide as text input
3. Use alternative tools: [list specific tools or services]
4. Proceed with partial output acknowledging limitations: [describe what can still be accomplished]

Code Examples

Example: Python Script with Fallback Behavior

python
def extract_with_fallback(pdf_path):
    """Attempt PDF extraction with multiple methods, fail gracefully."""
    
    methods = [
        ("pdftotext", lambda p: run_shell(f"pdftotext {p} -")),
        ("PyMuPDF", lambda p: extract_with_pymupdf(p)),
        ("pdfplumber", lambda p: extract_with_pdfplumber(p)),
    ]
    
    failures = []
    for method_name, method_func in methods:
        try:
            result = method_func(pdf_path)
            if result:
                return {"success": True, "content": result}
        except Exception as e:
            failures.append(f"{method_name}: {str(e)}")
    
    # All methods failed - return graceful failure
    return {
        "success": False,
        "failures": failures,
        "message": "All extraction methods failed. Consider manual extraction or alternative source."
    }

Example: Response Template for Failed Tasks

markdown
## Task Status: PARTIALLY COMPLETE

### What Was Accomplished
- [List completed subtasks]

### What Could Not Be Completed
- [Deliverable X]: Blocked by [specific tool failure]
- [Deliverable Y]: Requires source material that could not be accessed

### Blocking Issues Summary
| Tool/Method | Attempts | Error |
|-------------|----------|-------|
| Tool A | 3 | [error details] |
| Tool B | 2 | [error details] |

### Partial Output (With Disclaimers)
[Insert best-effort work product]

### Recommendations
1. [Action item 1]
2. [Action item 2]

Key Principles

  1. Transparency Over Optimism: Clearly state what failed rather than obscuring limitations
  2. Document Attempts: Record which approaches were tried to prevent redundant work
  3. Preserve Value: Even partial output is better than no output, if properly disclaimed
  4. Enable Handoff: Make it easy for a human or different system to pick up where you left off
  5. No False Claims: Never mark a task as "complete" when core requirements are unmet

Anti-Patterns to Avoid

  • ❌ Silently skipping failed steps without documentation
  • ❌ Claiming success when deliverables are missing or unverified
  • ❌ Providing output without disclaimers about its reliability
  • ❌ Repeating the same failed approach without variation
  • ❌ Omitting specific error messages that would help diagnose the issue

Frequently asked questions

What does the Graceful Tool Failure AI skill do?

Report tool failures transparently and attempt minimal viable output with disclaimers

Why use Graceful Tool Failure on TypingMind?

Because you install it once and use it with any model. Graceful Tool Failure is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Graceful Tool Failure in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/OpenSpace/tree/main/benchmarks/gdpval/skills/graceful-tool-failure. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Graceful Tool Failure?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Graceful Tool Failure?

As many as you like. As long as a model supports skills, you can use Graceful Tool Failure with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Graceful Tool Failure AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇