Primitive Tool Primitives

Working through the limitations of file uploads and context size when building MCP tooling for a CMS.

Permalink
I've been working on the MCP tooling for the CMS and running into some interesting limitations on files and context size.
It's very common to have images, or maybe pdfs, or videos on a website. I was working on building out my personal website, and I wanted to upload an image. I took a picture from my phone, put it into the Claude chat, and then asked it to upload the image. Claude tried to base64 encode the image, and then post it to the cms with the assets_upload tool. Claude quickly realized it would blow through the conversation context and stopped. I was stuck. My tools had failed, and I didn't have anything at the moment.
I added another tool to generate a pre-signed url that Claude could post the image up to, and it tried, and failed. The sandbox prevented any outbound requests to my file bucket.
The next step was to go back to text. I created another tool that generated a user facing page where it logged you in automatically, let you upload the images through the browser, and then gave you some keys to paste back into your chat so that the LLM would be able to reference the files.
This is my current work around to the still primitiveness of these amazing AI tools.