MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / customize_manifest

Function customize_manifest

scripts/setup_slack.py:92–102  ·  view source on GitHub ↗

Customize the manifest template with the chosen bot name and command.

(
    manifest_str: str, app_name: str, display_name: str, slash_command: str
)

Source from the content-addressed store, hash-verified

90
91
92def customize_manifest(
93 manifest_str: str, app_name: str, display_name: str, slash_command: str
94) -> str:
95 """Customize the manifest template with the chosen bot name and command."""
96 manifest = json.loads(manifest_str)
97 manifest["display_information"]["name"] = app_name
98 manifest["features"]["bot_user"]["display_name"] = display_name
99 for cmd in manifest.get("features", {}).get("slash_commands", []):
100 if cmd.get("command") == "/agent":
101 cmd["command"] = slash_command
102 return json.dumps(manifest, indent=2)
103
104
105def validate_bot_token(token: str) -> tuple[bool, str]:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected