Skip to content

Fix list_accessible_customers to return JSON-formatted string#14

Open
PhilipJohnBasile wants to merge 1 commit intogoogleads:mainfrom
PhilipJohnBasile:fix/list-accessible-customers-json-format
Open

Fix list_accessible_customers to return JSON-formatted string#14
PhilipJohnBasile wants to merge 1 commit intogoogleads:mainfrom
PhilipJohnBasile:fix/list-accessible-customers-json-format

Conversation

@PhilipJohnBasile
Copy link

Fixes issue where FastMCP converts list return type into multiple text items that get concatenated.

Changes

  • Changed return type from List[str] to str
  • Returns JSON object with customer_ids array and count
  • Prevents FastMCP from concatenating customer IDs into single string
  • Claude now receives parseable JSON instead of concatenated IDs

Before

123456789023456789013456789012

After

{
  "customer_ids": ["1234567890", "2345678901", "3456789012"],
  "count": 3
}

@PhilipJohnBasile
Copy link
Author

@DeanLukies can you take a look at this?

@Raibaz
Copy link
Collaborator

Raibaz commented Feb 2, 2026

I am honestly puzzled by this, as FastMCPs renders List[str] as one string per row, with a newline between each string.

Do you have more context on where you experienced the issue of strings being concatenated?

@jayflaherty75
Copy link

What is the impact of this change? It seems like it breaks contract to solve a problem elsewhere (FastMCP). Typically, I'd add a JSON version of the function returning the result from the original. In some dark corners, a JSON flag would be added but we don't talk about that. =b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants