FabricFabric
Features

LLM Tool (`call_llm`)

Invoke a secondary LLM for focused subtasks. The tool loads file content automatically from paths you provide.

Invoke a secondary LLM for focused subtasks. The tool loads file content automatically from paths you provide.

When to Use

Use CaseModelFeatures
Summarize large filehaikuattachments
Classify contenthaikuoutputFormat: "classification"
Extract structured datahaikuoutputSchema
Deep analysissonnet/opusthinking: true (API key only)
Parallel processinganyMultiple calls in one message

Authentication Paths

Features depend on how you authenticate:

FeatureAPI KeyOAuth
Text attachmentsYesYes
Image attachmentsYesNo
Structured outputGuaranteed (tool_choice)Prompt-based
Extended thinkingYesNo
All modelsYesYes
  • API key: Full features via direct Anthropic SDK
  • OAuth: Basic features via agent-native callback

Parameters

ParameterTypeDescription
promptstringInstructions for the LLM (required)
attachmentsarrayFile/image paths to include
modelstringAny model from the model registry. Defaults to Haiku (fastest)
systemPromptstringOptional system prompt
maxTokensnumberMax output tokens (1-64000, default 4096)
temperaturenumberSampling temperature 0-1 (ignored if thinking=true)
thinkingbooleanEnable extended thinking (API key only)
thinkingBudgetnumberToken budget for thinking (1024-100000, default 10000)
outputFormatenumPredefined output format
outputSchemaobjectCustom JSON Schema

Attachments

// Simple file
attachments: ["/src/auth.ts"]

// Large file - use line range (required for files >2000 lines)
attachments: [{ path: "/logs/app.log", startLine: 1000, endLine: 1500 }]

// Mix of files and images (API key only for images)
attachments: ["/src/component.tsx", "/designs/mockup.png"]

Line Ranges

For files larger than 2000 lines or 500KB, you must specify a line range:

{ path: "/path/to/large-file.log", startLine: 100, endLine: 600 }

The tool will tell you the file structure if you try to load a file that's too large.

Supported Formats

  • Text files: Any UTF-8 encoded file (.ts, .js, .py, .md, .json, etc.)
  • Images: .png, .jpg, .jpeg, .gif, .webp (max 5MB each, API key only)

Output Formats

FormatReturns
summary{ summary, key_points[], word_count }
classification{ category, confidence, reasoning }
extraction{ items[], count }
analysis{ findings[], issues[], recommendations[] }
comparison{ similarities[], differences[], verdict }
validation{ valid, errors[], warnings[] }

Parallel Processing

Call multiple times in a single message for parallel execution:

call_llm(prompt: "Summarize", attachments: ["/file1.ts"])
call_llm(prompt: "Summarize", attachments: ["/file2.ts"])
call_llm(prompt: "Summarize", attachments: ["/file3.ts"])
// All run simultaneously - ~3x faster than sequential!

Use cases for parallel calls:

  • Analyze multiple files at once
  • Get multiple perspectives on the same code
  • Process batch data
  • Generate variations

Examples

Summarize a File (Cheap)

call_llm({
  prompt: "Summarize the main functionality",
  attachments: ["/src/auth/handler.ts"],
  model: "claude-haiku-4-5-20251001"
})

Extract Structured Data

call_llm({
  prompt: "Extract all API endpoints from this file",
  attachments: ["/src/routes.ts"],
  outputSchema: {
    type: "object",
    properties: {
      endpoints: {
        type: "array",
        items: {
          type: "object",
          properties: {
            method: { type: "string" },
            path: { type: "string" },
            handler: { type: "string" }
          }
        }
      }
    },
    required: ["endpoints"]
  }
})

Classify Content

call_llm({
  prompt: "Classify this support ticket by urgency and category",
  attachments: ["/tickets/latest.txt"],
  outputFormat: "classification"
})
// Returns: { category: "billing", confidence: 0.92, reasoning: "..." }

Deep Analysis with Thinking (API Key Only)

call_llm({
  prompt: "Analyze this algorithm for edge cases and potential bugs",
  attachments: ["/src/sorting.ts"],
  model: "claude-sonnet-4-5-20250929",
  thinking: true,
  thinkingBudget: 15000
})

Analyze Screenshot (API Key Only)

call_llm({
  prompt: "Describe the UI issues in this screenshot",
  attachments: ["/screenshots/bug-report.png"],
  model: "claude-sonnet-4-5-20250929"
})

Constraints

ConstraintLimit
Max attachments20 per call
Max text file size2000 lines or 500KB
Max image size5MB
Max total content2MB across all attachments
thinking + structured outputMutually exclusive
thinking + haikuNot supported (use Sonnet/Opus)
thinking + OAuthNot supported (use API key)
images + OAuthNot supported (use API key)

Error Handling

The tool provides detailed error messages with recovery suggestions. Common errors:

Attachment Errors

ErrorCauseSolution
File not foundPath doesn't existCheck path spelling, use absolute paths
File too large>2000 lines or >500KBUse line range: { path, startLine, endLine }
Line range too largeRange exceeds 2000 linesReduce range or split into multiple calls
Binary file detectedNon-text file without image extensionUse only text files or supported images
Permission deniedCannot read fileCheck file permissions
Empty fileFile has no contentSkip empty files
Broken symlinkSymlink target missingFix or remove symlink

Parameter Errors

ErrorCauseSolution
thinking + outputFormatIncompatible modesRemove one option
thinking + haikuHaiku doesn't support thinkingUse Sonnet or Opus
thinking + OAuthOAuth doesn't support thinkingUse API key or remove thinking
images + OAuthOAuth doesn't support imagesUse API key or remove images
thinkingBudget without thinkingMissing thinking=trueAdd thinking: true
Invalid line rangestartLine > endLineFix range values
Unknown modelModel not in registryCheck available models in settings

API Errors (API Key Path)

StatusMeaningRecovery
401Invalid API keyCheck/refresh credentials
403Access deniedVerify model access on your plan
429Rate limitedReduce parallel calls, wait before retry
500/502/503API unavailableRetry in a few seconds

When NOT to Use

  • You can reason through it yourself without needing a cheaper model
  • The task requires your conversation context
  • You need tools (Read, Bash, Glob) - use Task tool with subagents instead
  • Simple one-liner responses that don't need isolation

On this page