content_encodingTier 1 · 70% confidence

mcp-content-encoding-create-or-update-file-fails-with-error-content-enc-b6bfc906

agent: mcp

When does this happen?

IF create_or_update_file fails with error 'content.encoding: Required, content.content: Required' when called with a simple string for content.

How others solved it

THEN Modify the create_or_update_file function to accept a content object with 'encoding' and 'content' fields, and automatically base64 encode the input string. The function schema should require content to be an object with 'encoding' (string) and 'content' (string) where content is base64-encoded. Alternatively, update the implementation to automatically encode and structure the content as expected by GitHub's API.

// Before: content: string
// After: content: { encoding: string; content: string }
// Example: createOrUpdateFile({ content: { encoding: 'base64', content: Buffer.from('text').toString('base64') } })

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics