agentleFS
a1ecbr0wna1ecbr0wn/obsidian-mcp-brain/skills/upload-file/SKILL.md

upload-file

Skill1 starsChanged 17 days agoApache-2.0View on GitHub

Put a local file (a PDF, image or other binary) into an Obsidian vault through the obsidian-mcp-brain server's upload-file tool, without base64-encoding it. Use whenever the user asks to add, save, file or upload a local file to the vault, and the file is more than a few KB or the server offers upload-file.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. 0gfoundation/0g-agent-skills★ 15same name
    2. mia-cx/skills★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the helper from this skill's directory: scripts/upload-file.sh.

    line 22
  2. Very specific:

    Reserve: Call the upload-file tool with vault, filename, size and sha256 exactly as printed, plus folder for where it should go in the …

    line 27
  3. Distinctive:

    Do the three steps back to back.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Upload a local file to the vault

upload-file reserves a one-time URL on the MCP server; the file then goes straight from disk to the server with curl, so its bytes never pass through you. Use this instead of create-file, which needs the whole file as base64 text in a tool call. That is slow, costs a large number of tokens, and a single wrong character corrupts the file.

This workflow needs a shell on a machine that can reach the MCP server. If you have no shell, use create-file for small files and tell the user it is not possible for large ones.

Steps

Run the helper from this skill's directory: scripts/upload-file.sh.

  1. Prepare. sh scripts/upload-file.sh prepare "<path to the local file>" prints filename=, size= and sha256= lines.
  2. Reserve. Call the upload-file tool with vault, filename, size and sha256 exactly as printed, plus folder for where it should go in the vault. The result contains a one-time URL.
  3. Send. sh scripts/upload-file.sh send "<path to the local file>" "<the URL>". It uploads the file, then checks the server's reply against the local file and prints uploaded <vault path> ... verified against the local file on success.

Do the three steps back to back. The URL expires after a few minutes and works once.

Rules

  • Never work out the hash or size by hand, and never paste the file's contents into a tool call. Use prepare; it is the only source for size and sha256.
  • Do not reuse a URL. Any request to it, even a failed one, uses it up. Call upload-file again for a new one.
  • Do not share or log the URL. The helper never prints it.
  • Choose the destination before reserving. An upload never overwrites: the name must not already exist in the vault. To replace a file that is there, use the replace-file skill.

When it fails

The helper reportsMeaningWhat to do
404The URL expired or was already usedReserve a new URL (step 2) and send again
403The request carried an Origin header, came from a different address from the one that reserved it (only when the server checks that), or the destination is not allowedCheck the machine that ran send is the one that is connected to the server; if the path is restricted, tell the user
409, or the tool itself says the file already existsThe destination exists (or appeared after the URL was reserved)Choose another filename or folder, or ask the user; to replace the existing file use the replace-file skill
422The file does not match the declared hash (it changed, or was damaged)Run prepare again, then reserve a new URL
400 saying a note must be valid UTF-8The file is a .md note whose bytes are not UTF-8 textFix the encoding, or tell the user; do not send it under another extension
411, 413 or 400The declared size does not match the file, or exceeds the upload limitRun prepare again; if the file is over the limit, tell the user
503Too many uploads in progressWait a few seconds and start again from step 2
curl could not connectThe URL's address is not reachable from this machineTell the user: the server's mcpBaseUrl may be wrong for this client

Report any other failure to the user with the message the helper printed.

Reading the file back

To check the upload or read a PDF afterwards, use read-file, then open the saved path it returns with your file-reading tool. If it times out on a large file, call it again.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.