Skip to content

Commit 1d144fe

Browse files
committed
fix: update material and protocol title formatting in step content
1 parent 0041696 commit 1d144fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/protocols_io_mcp/tools/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def to_string(step: "ProtocolStepInput") -> str:
3737
if len(step.materials) > 0:
3838
step_content += "[Materials]\n"
3939
for material in step.materials:
40-
step_content += f"- {material.name.replace(' ', '')} {material.quantity} {material.unit.replace(' ', '')}\n"
40+
step_content += f"- {material.name.replace(' ', '_')} {material.quantity} {material.unit.replace(' ', '_')}\n"
4141
# add reference protocols to step content
4242
if len(step.reference_protocol_ids) > 0:
4343
if len(step.materials) > 0:
@@ -49,7 +49,7 @@ async def to_string(step: "ProtocolStepInput") -> str:
4949
if response_get_protocol["status_code"] != 0:
5050
return response_get_protocol["status_text"]
5151
protocol = await Protocol.from_protocol_id(response_get_protocol["payload"]["id"])
52-
step_content += f"- {protocol.title}[{protocol.id}] {protocol.doi}\n"
52+
step_content += f"- {protocol.title.replace('[', '<').replace(']', '>')}[{protocol.id}] {protocol.doi}\n"
5353
return step_content
5454

5555
class ProtocolStep(BaseModel):

0 commit comments

Comments
 (0)