st-eval
/st-eval
Smalltalk code evaluator for Pharo or Squeak via MCP. Use when executing Smalltalk expressions, verifying object state or intermediate values, debugging code incrementally, checking the Smalltalk image connection, or running quick experiments.
- Author
- mumez ↗
- Repository
- smalltalk-dev-plugin ↗
- Licence
- MIT
- Last repository change
- 21.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Smalltalk code evaluator for Pharo or Squeak via MCP. Use when executing Smalltalk expressions, verifying object state or intermediate values, debugging code incrementally, checking the Smalltalk image connection, or running quick experiments.
Original author description
Smalltalk code evaluator for Pharo or Squeak via MCP. Use when executing Smalltalk expressions, verifying object state or intermediate values, debugging code incrementally, checking the Smalltalk image connection, or running quick experiments.
How it works
- Essential Rules
- Common Patterns
- Troubleshooting
- Related Skills
SKILL.md preview
---
name: st-eval
description: Smalltalk code evaluator for Pharo or Squeak via MCP. Use when executing Smalltalk expressions, verifying object state or intermediate values, debugging code incrementally, checking the Smalltalk image connection, or running quick experiments.
allowed-tools: mcp__smalltalk-interop__eval
---
# Execute Smalltalk Code
Evaluate arbitrary Smalltalk expressions in the running Smalltalk image via `mcp__smalltalk-interop__eval`.
## Essential Rules
**Always use `printString`** — MCP returns serialized output. Raw objects cause errors or unreadable results:
```smalltalk
✅ MyClass new doSomething printString
✅ collection printString
❌ MyClass new doSomething
```
**Wrap risky code in `on:do:`** — Uncaught errors in eval crash the MCP call with no useful message:
```smalltalk
| result |
result := Array new: 2.
[ result at: 1 put: (riskyOperation) printString ]
on: Error do: [:ex | result at: 2 put: ex description].
^ result
```
**Use `fork` for blocking operations** — Code that opens a dialog or blocks the image will cause the MCP call to hang indefinitely. Detach it:
```smalltalk
[ <blocking expression> ] fork.
^ 'started'
```
## Common Patterns
### Connection check
```smalltalk
Smalltalk version
```
### Inspect intermediate values
```smalltalk
| step1 step2 |
step1 := objA computeStep1.
step2 := step1 processStep2.
^ { 'step1' -> step1 printString. 'step2' -> step2 printString } asDictionary printString
```
### Inspect object state
```smalltalk
{
'class' -> obj class name.
'value' -> obj printString.
'size' -> obj size printString
} asDictionary printString
```
### Safe collection access
```smalltalk
collection ifEmpty: ['empty'] ifNotEmpty: [:col | col first printString]
```
### Error-capturing eval
```smalltalk
| result |
result := Array new: 2.
[
| obj |
obj := MyClass new name: 'Test'.
result at: 1 put: obj process printString.
] on: Error do: [:ex |
result at: 2 put: ex description
].
^ result
```
## Troubleshooting
| Symptom | Cause | Fix |
|---------|-------|-----|
| MCP call hangs / no response | Blocking operation (dialog, modal, infinite loop) | Wrap in `fork` |
| `Error: cannot serialize` | Returning raw object | Add `printString` |
| Debugger window opened in the Smalltalk image | Uncaught error triggered the debugger | Close debugger in the Smalltalk image, then re-eval with `on:do:` |
| `MessageNotUnderstood` | Method doesn't exist or typo | Check with `mcp__smalltalk-interop__search_implementors` |
## Related Skills
- `smalltalk-dev:smalltalk-debugger` — Systematic debugging workflow using eval
- `smalltalk-dev:st-init` — Verify the Smalltalk image connection if eval fails unexpectedly
Versions
The database has no other skills named st-eval.
Database snapshot: 13.11.2026 · package version 621732e65606 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100st-test
Run SUnit tests in the running Smalltalk image (Pharo or Squeak). Use when verifying changes after import, or when checking results for a specific test class or package. - 100st-import
Import Tonel package into the running Smalltalk image (Pharo or Squeak). Use when loading edited .st files into the Smalltalk image after code changes.