MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / parse_headers

Function parse_headers

mini_agent/skills/mcp-builder/scripts/evaluation.py:275–287  ·  view source on GitHub ↗

Parse header strings in format 'Key: Value' into a dictionary.

(header_list: list[str])

Source from the content-addressed store, hash-verified

273
274
275def parse_headers(header_list: list[str]) -> dict[str, str]:
276 """Parse header strings in format 'Key: Value' into a dictionary."""
277 headers = {}
278 if not header_list:
279 return headers
280
281 for header in header_list:
282 if ":" in header:
283 key, value = header.split(":", 1)
284 headers[key.strip()] = value.strip()
285 else:
286 print(f"Warning: Ignoring malformed header: {header}")
287 return headers
288
289
290def parse_env_vars(env_list: list[str]) -> dict[str, str]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected