We build custom applications 5x faster and cheaper đ
Book a Free Consultation
Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.
To integrate a Markdown Converter with OpenClaw you host the converter as an explicit external HTTP API, register a skill in ClawHub that points to the converter (or to a small adapter service), configure authentication (OAuth2 or API key) and any required environment variables in ClawHub, and implement deterministic request/response mappings and validation so the OpenClaw agent can call the converter reliably at runtime. Keep persistent state and file storage outside the agent runtime, validate webhooks/tokens, and use standard debugging steps (logs, API responses, token scopes, and retries) when things fail.
This is a simple HTMLâMarkdown converter using turndown. It demonstrates the external API the skill will call. It is a minimal, real example you can run and test locally. Replace auth checks and production settings as needed.
<b>//</b> server.js - simple converter
const express = require('express');
const bodyParser = require('body-parser');
const TurndownService = require('turndown');
const app = express();
app.use(bodyParser.json({ limit: '1mb' }));
<b>//</b> Simple middleware to require a bearer token for server-to-server auth
app.use((req, res, next) => {
const auth = req.get('Authorization') || '';
const expected = process.env.CONVERTER_API_KEY || 'test-key';
if (!auth.startsWith('Bearer ') || auth.slice(7) !== expected) {
return res.status(401).json({ error: 'unauthorized' });
}
next();
});
app.post('/convert', (req, res) => {
<b>//</b> Accepts { content: "<html>...</html>", inputType: "html" } and returns { markdown: "..." }
const { content, inputType } = req.body || {};
if (!content || inputType !== 'html') {
return res.status(400).json({ error: 'invalid input; expected {content, inputType: "html"}' });
}
const turndownService = new TurndownService();
try {
const markdown = turndownService.turndown(content);
return res.json({ markdown });
} catch (err) {
console.error('conversion error', err);
return res.status(500).json({ error: 'conversion failed' });
}
});
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`Markdown converter listening on ${port}`);
});
The agent or skill runtime should call your converter with a bearer token. This is a generic cURL example showing the expected shape.
<b>//</b> Example request to the external Markdown Converter
curl -X POST 'https://your-converter.example.com/convert' \
-H 'Authorization: Bearer your-api-key' \
-H 'Content-Type: application/json' \
-d '{"content": "<h1>Hello</h1><p>World</p>", "inputType": "html"}'
Expected JSON response:
{
"markdown": "# Hello\n\nWorld"
}
Speak oneâonâone with a senior engineer about your noâcode app, migration goals, and budget. In just half an hour youâll leave with clear, actionable next stepsâno strings attached.
1
The plugin usually fails because the runtime can't load or register the converter: common causes are a wrong or missing entrypoint/manifest, the package not installed in the agent runtime, an import-time dependency error, missing environment variables or credentials, permission/permission-scopes preventing registration, or a ClawHub registration mismatch or version incompatibility. The error messages "Unknown converter" / "Failed to load plugin" come from these failures to initialize and register the skill.
Check logs and the agent runtime import errors, confirm the plugin package is installed in the runtime, verify the plugin manifest/entrypoint matches what ClawHub expects, ensure required env vars/API keys are set and permissions granted, and reinstall or re-register the plugin in ClawHub. Reproduce a simple import in the runtime and inspect stack traces to find the failing step.
2
Update the OpenClaw content pipeline so files matching .md and .markdown are routed to the Markdown Converter adapter by adding a routing rule (glob or extension match) that targets the adapter ID and any adapter options; then reload/redeploy the pipeline so the runtime picks up the rule.
// example Node-style pipeline config used by the runtime
module.exports = {
pipeline: {
routes: [
{
// match by extension or glob
match: ['**/*.md', '**/*.markdown'],
// adapter id as registered in ClawHub
adapter: 'markdownConverter',
// optional adapter options
options: { preserveFrontMatter: true }
}
]
}
};
3
Direct answer: The Markdown Converter strips YAML front matter because it treats that block as metadata rather than document content and removes it during rendering; OpenClaw expects metadata to be supplied through explicit inputs (skill parameters, ClawHub config, or environment variables) and not embedded in rendered Markdown.
This behavior is deliberate: front matter is parsed out so the renderer outputs only body text and avoids leaking config or secrets. How to handle it:
4
Slow rendering/high memory from the OpenClaw Markdown Converter usually means youâre loading too much into the agent runtime at once. Fixes: stream or chunk conversion, move heavy work to an external service/process, increase runtime memory and timeouts, and profile to find hotspots.
This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.
From startups to enterprises and everything in between, see for yourself our incredible impact.
Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. Weâll discuss your project and provide a custom quote at no cost.Â